Disclosure of Invention
According to the embodiment of the invention, the regional division display method of the autonomous controllable new generation transformer substation is provided, and the rapid and effective display of the geographical region division of the transformer substation and the position relation of the actual geographical region are realized by analyzing the geographical region information of the SSD file.
In order to solve the technical problems, the embodiment of the invention provides a regional division display method of an autonomous controllable new generation transformer substation, which is based on a system specification description SSD file, wherein the system specification description SSD file adopts xml language to describe geographical region information of the transformer substation, the geographical region information is composed of a plurality of node information in the xml file, and the method comprises the following steps:
Analyzing the system specification description SSD file, extracting node information and selecting key node information of a geographic area;
Setting a drawing and displaying principle for displaying the geographical area information of the transformer substation;
Traversing key node information of the geographic area according to a display algorithm of the geographic area information, and drawing and displaying regional division information of the transformer substation according to the drawing and displaying principle.
Further, the extracting node information includes: extracting the geographical area node information, the substation equipment model node information, the cable connection node information and the inclusion relation among the geographical area node information; the selecting the key node information of the geographical area includes selecting the geographical area node information as the key node information of the geographical area.
Further, the node information includes an element and an element attribute definition, and the element attribute definition of the geographical area node information includes at least a name, a chinese description desc, and spatial location information coordinates.
Further, the Substation is used as a Substation node, the geographical area node information under the Substation node is classified, the classified geographical area node information comprises a root node and all levels of sub-nodes of the root node, and the key node information for traversing the geographical area comprises traversing the root node and all levels of sub-nodes of the root node.
Further, the drawing and displaying principle of setting and displaying the geographical area information of the transformer substation comprises the following four principles:
1) Coordinate axis definition: the vertical axis is an x axis, and north is defined as a positive direction; the horizontal axis is the y axis, and the east is defined as the positive direction; the lower left point is the origin (0, 0);
2) Direction definition: the upper part is north, the lower part is south, the left part is Fang Xiangxi, and the right part is east;
3) When the element attribute definition of the geographical area node information includes a diagonal coordinate identifier rect, the diagonal coordinate identifier rect is determined, and if the diagonal coordinate identifier rect is true, coordinates (x 1, y1: x2, y 2) represents a rectangular region, wherein (x 1, y 1) and (x 2, y 2) are two diagonal coordinates of the rectangular region respectively, and are displayed in a rectangular shape when displayed; if the diagonal coordinate mark rect is false, the coordinates (A1, B1: A2, B2: A3, B3) of the spatial position information coordinates represent an irregular area, wherein the irregular area is a closed curve which is connected end to end, and the coordinates (A1, B1), (A2, B2) and (A3, B3) are the coordinates of 3 points which are connected end to end of the irregular area respectively;
4) The Substation node is used as the uppermost region for drawing and displaying, and the coordinates of the lower left point of the Substation node are (0, 0); the coordinates (x, y) of the spatial position information coordinates are relative coordinates, that is, the upper left point of the upper layer region above the lower layer region is the origin of the coordinate system.
Further, the traversing the key node information of the geographical area according to the display algorithm of the geographical area information, and the drawing and displaying the area division information of the transformer substation according to the drawing and displaying principle comprises the following steps:
(1) Analyzing the system specification description SSD file, and finding out the Substation node;
(2) Acquiring root node information under the subttation node;
(3) Judging whether the nth root node is drawn or not; when the nth root node is judged to be drawn, entering the step (4); when the nth root node is judged to be not drawn, the step (5) is entered;
(4) Judging whether the nth root node is the last root node, if not, adding 1 to n, and returning to the step (3), if so, drawing the display graph;
(5) Drawing a display graph according to the root node spatial position information coordinates;
(6) Judging whether all levels of child nodes of the nth root node are drawn, if so, entering the step (4), otherwise, entering the step (7);
(7) And (3) drawing a display graph according to the spatial position information coordinates of each level of child nodes of the nth root node, and returning to the step (6).
Further, the obtaining the root node information under the subttation node includes:
And recording the geographical area node information under the subtstation node to a stack, and acquiring the root node information.
Further, after parsing the system specification description SSD file and finding a Substation node, the method further includes the steps of:
checking whether the coordinate format of all the geographical area node information in the subtstation nodes is correct or not;
If the verification is correct, continuing to the next step, otherwise, carrying out alarm prompt and exiting the display.
Further, the checking whether the coordinate format of the node information of all the geographical areas in the subttation node is correct includes: when the diagonal coordinate mark rect is true and the coordinates are in the (x 1, y1: x2, y 2) format, checking correctly; when the diagonal coordinate mark rect is false and the coordinates are in the format of (A1, B1: A2, B2: A3, B3), checking to be correct; otherwise, the verification is incorrect.
Another embodiment of the invention provides a computer-readable storage medium on which computer program instructions are stored, characterized in that the computer program instructions, when executed by a processor, implement a zone division presentation method of an autonomously controllable new generation substation.
The technical scheme provided by the embodiment of the invention has the following beneficial technical effects:
According to the method, the containing relation among the node information of the geographic area is included when the key node information of the geographic area is selected, and when the area is divided and displayed, the containing relation can be straightened to be positioned to the sub-nodes, the graph of the sub-nodes is drawn, and the omission of the area information represented by the sub-nodes is avoided; according to the method, an algorithm for displaying the geographical area information is researched to traverse the geographical area information nodes for drawing and displaying, so that display of geographical area division of the transformer substation and display of the position relation of the actual geographical area are realized by analyzing the geographical area information of the SSD file; the invention adds a checking flow of the coordinate format in the display algorithm, can quickly position error information, and avoids the calculation of a large amount of data in the subsequent display process.
Detailed Description
The objects, technical solutions and advantages of the present invention will become more apparent by the following detailed description of the present invention with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the invention. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present invention.
The embodiment of the invention provides a regional division display method for an autonomous controllable new generation transformer substation. The method analyzes the system specification description SSD file, extracts node information and selects key node information of a geographic area.
The technical specification general series specification 8 of the secondary system of the autonomous controllable new generation transformer substation is that a transformer substation geographic area model is added on the basis of the DL/T1874 standard and is used for describing the geographic structure of a transformer substation and the association of equipment in the transformer substation with the geographic structure. The SSD file is an xml file, the area information of the SSD is composed of a plurality of node information in the xml file, and the definition of elements and attributes contained in the node information is the first definition in the technical Specification general series Specification 8 substation equipment information model of the secondary system of the independent controllable new generation substation, which is a new demand.
The technical specification general series specification 8 transformer substation equipment information model of the autonomous controllable new generation transformer substation secondary system defines geographical area models including an area model, a screen cabinet model, a physical equipment model and the like, wherein the area model comprises a surrounding wall, a switch field, a space place, a building, a floor, a room, a road, a cable duct and the like, and the specification specifically defines the following table 1 (the definition of each element and attribute of SSD geographical area information):
When the SSD file is analyzed, the information such as the geographical area node, the device equipment node, the cable connection node and the inclusion relation among the geographical area node information is extracted:
geographical area node information: wall, building, floor, room, switchArea, bayArea, road, ditch, door, otherArea, preCabinet, cabinet;
substation equipment model node information associated with a geographic structure: GENERALDEVICE, CONDUCTINGDEVICE, BOARD, PORT;
Cable connection node information: cable, cable Terminal, cableConnectivityNode;
the inclusion relationship between the geographical area node information includes:
For example, the Building may include a Floor, the Floor may include Room, the Room node may include Cabinet, door, or directly include the substation equipment model node information such as GENERALDEVICE, CUNDUCTINGDEVICE;
SWITCHAREA may contain BayArea, otherArea and road, bayArea may contain Cabinet or directly contain GENERALDEVICE, CUNDUCTINGDEVICE substation equipment model node information;
the Cabinet is Cabinet information and can contain GENERALDEVICE or CunductingDevice substation equipment model node information.
The Substation is taken as a root node, geographical area node information under the Substation node is classified, the classified nodes comprise root nodes and all levels of child nodes of the root nodes, 1 level root nodes comprise Building or Wall or SWITCHAREA,2 levels of child nodes comprise Floor or BayArea,3 levels of child nodes comprise Room and Cabinet, and 3 levels of child nodes comprise Cabinet.
In the display of the regional division of the transformer substation, namely the display of the geographical region information of the transformer substation in the SSD, the position of geographical region node information is only required to be displayed in the current specification, so that the geographical region node information is selected as key node information, a stack is required to be stored for later use, GENERALDEVICE or CunductingDevice nodes are primary equipment models, the relationship of the nodes in the SSD is used for reflecting the association relationship between the primary equipment reference and the geographical models, namely whether the association relationship between the regional information and the primary equipment is required to be established or not is represented, and the geographical region information only requires to be displayed to the minimum node level of a transformer substation screen cabinet and does not require to display the position relationship of the primary equipment, so GENERALDEVICE or CunductingDevice are not required to be displayed; the substation equipment model node information, the cable connection node information and the like do not need to be stored and displayed.
The invention extracts the containing relation among the geographical area node information when analyzing the SSD, and can quickly locate the child nodes and draw the graph of the child nodes and avoid missing the area information represented by the child nodes by straightening the containing relation when displaying the area division.
After the key node information of the geographical area is selected, the invention designs the drawing and displaying principle for displaying the geographical area information of the transformer substation.
Specifically based on the following 4 presentation principles:
1) Coordinate axis definition: the lower left point is the origin (0, 0); the vertical axis is the x axis, and the north is the positive direction; the horizontal axis is the y axis, and the direction east is the positive direction;
2) Northeast and northwest directions: north, south, west and east;
3) When the diagonal coordinate identifier rect is true, coordinates is the coordinate (x 1, y1: x2, y 2) represents a rectangular region, wherein (x 1, y 1) and (x 2, y 2) are two diagonal coordinates of a rectangle, and are displayed in a rectangle when displayed; when rect is false, the coordinates (A1, B1: A2, B2: A3, B3) of coordinates represent irregular areas, which are closed curves connected in sequence and connected end to end, wherein (A1, B1), (A2, B2) and (A3, B3) are coordinates of 3 points connected end to end. In the node information of the geographical area of the SSD, the combination of the spatial coordinate positions of the area is described, and the two coordinate positions are divided by a ':'. When the rect attribute is true, the number of the space coordinates is 2, two opposite angles of the rectangle are represented, and the format is (x 1, y1: x2, y 2); when the rect attribute is false, the number of the space coordinates > =3, which represents a closed curve with the space coordinates connected in sequence and connected end to end, and the format is (A1, B1: A2, B2: A3, B3).
4) The (x, y) in the region spatial position information attribute is the relative coordinates: the upper left point of the upper layer area above the lower layer area is the origin of the coordinate system; the Substation layer is the uppermost layer region, and the lower left dot coordinates are (0, 0).
The multi-floor display method is divided tab page display, namely if floor exists in the geographical area of the transformer substation, the top views of different floors are displayed in the form of multiple tab pages, namely the 1 st tab page displays the top view of the whole station 1 floor, the 2 nd tab page displays the top view of the whole station 2 floor, and so on, and the display effect is simple and clear.
Finally, traversing key node information of the geographic area according to a display algorithm of the geographic area information, and drawing and displaying regional division information of the transformer substation according to a drawing and display principle.
Referring to fig. 2, the flow of the algorithm is shown as follows:
Firstly, analyzing an SSD file, and finding out a node Substation;
Then, checking the coordinate formats of all geographical area nodes in the Substation nodes: when the attribute rect is true, the coordinates are in the format of (x 1, y1: x2, y 2); when rect is false, the coordinates are in the format of (A1, B1: A2, B2: A3, B3). After the coordinate format is checked successfully, continuing to the next step, otherwise, warning to prompt that the coordinate format is wrong and exiting the display;
recording node information of each geographical area under a subtstation node to a stack to acquire node information;
according to the node stack information, whether each node is mapped is confirmed, and the method is as follows:
a root node is found in the stack, such as Building or Wall or SWITCHAREA;
drawing a region position information display graph of the node according to the actual coordinate position of the root node;
recording the coordinates of the upper left point of the root node graph, and taking the coordinates as coordinates (0, 0) of the level 2 child nodes;
A level 2 child node under the root node, such as Floor or BayArea, is found in the stack;
determining the relative position through the space position information coordinates of the level 2 sub-node, drawing the region position information display graph of the level 2 sub-node (if floor is a plurality of layers, each layer draws a tab page, and each layer top view corresponds to the respective display tab page);
recording the coordinates of the upper left point of the 2-level child node graph, and taking the coordinates as the coordinates (0, 0) of the 3-level child node;
a level 3 child node under the level 2 child node, such as Room, cabinet, is found in the stack;
Determining the relative position through the space position information coordinates of the 3-level child nodes, and drawing the area position information display graph of the 3-level nodes;
recording the coordinates of the upper left point of the 3-level child node rectangle, and taking the coordinates as coordinates (0, 0) of the 4-level child node;
a level 4 child node, such as a Cabinet, below the level 3 child node is found in the stack;
Determining the relative position through the space position information coordinates of the level4 sub-node, and drawing the area position information display graph of the level4 sub-node;
by analogy, each root node and the regional position information display graph of the sub node to which the root node belongs search space position information coordinates and draw display graphs according to the method;
And after the final root node and the child nodes thereof have completed drawing the display diagram, ending the algorithm.
Another embodiment of the present invention is directed to a non-volatile storage medium storing a computer readable program for causing a computer to perform some or all of the method embodiments described above.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explanation of the principles of the present invention and are in no way limiting of the invention. Accordingly, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present invention should be included in the scope of the present invention. Furthermore, the appended claims are intended to cover all such changes and modifications that fall within the scope and boundary of the appended claims, or equivalents of such scope and boundary.