CN113342907B - Energy consumption information acquisition system distribution room topology portrait drawing method and system - Google Patents

Energy consumption information acquisition system distribution room topology portrait drawing method and system Download PDF

Info

Publication number
CN113342907B
CN113342907B CN202110722846.6A CN202110722846A CN113342907B CN 113342907 B CN113342907 B CN 113342907B CN 202110722846 A CN202110722846 A CN 202110722846A CN 113342907 B CN113342907 B CN 113342907B
Authority
CN
China
Prior art keywords
node
coordinate
depth
current
coordinates
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
Application number
CN202110722846.6A
Other languages
Chinese (zh)
Other versions
CN113342907A (en
Inventor
豆燕蕊
徐军
郝立法
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Integrated Electronic Systems Lab Co Ltd
Original Assignee
Integrated Electronic Systems Lab Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Integrated Electronic Systems Lab Co Ltd filed Critical Integrated Electronic Systems Lab Co Ltd
Priority to CN202110722846.6A priority Critical patent/CN113342907B/en
Publication of CN113342907A publication Critical patent/CN113342907A/en
Application granted granted Critical
Publication of CN113342907B publication Critical patent/CN113342907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • G06F16/287Visualization; Browsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Marketing (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Public Health (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a method and a system for drawing a topological portrait of a station area of an energy-using information acquisition system, which are used for generating an indexed json object list with a parent-child relationship by analyzing data associated with a station area device of a database system, calculating coordinates of each node, and adopting a topological portrait drawing method of the station area based on a Canvas AP I tool at a system master station end, so that automatic drawing can be realized on a browser page, the subordination relationship among various devices, the real-time running state of the devices and the abnormal situation of a circuit can be clearly displayed, the real-time monitoring is realized, the local redrawing efficiency is high, the page is not blocked, redundant and fussy files are not generated, all the files are dynamically loaded on a Canvas object through JavaScript, compared with a table query mode and an SVG drawing mode, the data is more visual, the loading efficiency is higher, and convenience is brought to system maintainers to monitor the running situation of the station area.

Description

Energy consumption information acquisition system distribution room topology portrait drawing method and system
Technical Field
The invention relates to the technical field of power system maintenance, in particular to a method and a system for drawing a topological portrait of a platform area of an energy consumption information acquisition system.
Background
The transformer area topology portrait is the basis for power system maintenance and power grid management, and the running state and the distribution condition of a transformer meter box in a power system transformer area can be visually displayed. In the energy consumption information acquisition system, an administrator logs in the system and can visually check the real-time running state of a transformer area and the distribution condition of meter boxes.
At present, the distribution and the running state of other transformer meter boxes in a transformer area are mainly in two embodying modes, one mode is a table query mode for displaying, and the defects of the mode are as follows: the distribution conditions of the transformer and the meter box cannot be visually displayed, the abnormal conditions of the electric meter in the meter box cannot be displayed in real time, and the membership relationship between the meter box and the transformer cannot be clearly inquired, so that operation and maintenance personnel have redundancy and trouble in maintenance, cannot visually and timely detect the abnormality of the meter box, influences the working progress and further influences the electricity utilization users; another method is a SVG (Scalable Vector Graphics) based region topology rendering, which has the following disadvantages: SVG is a graphic language described by xml, data in a background database is fed back to a page, and then not only data processing is needed to generate a coordinate object, but also huge and tedious SVG files are generated, xml tags are generated for each line, each picture and each character area, necessary display attributes and marks are added for each tag, the rendering speed is reduced under the condition of high complexity, the SVG is not friendly to intensive portraits needing frequent redrawing, and the user experience is affected by page blocking.
Disclosure of Invention
The invention aims to provide a method and a system for drawing a topological portrait of a station area of an energy-consumption information acquisition system, which aim to solve the problems of low rendering speed and unsmooth page in the prior art, improve loading efficiency, more intuitively display data and facilitate monitoring of the operation condition of the station area.
In order to achieve the technical purpose, the invention provides a method for drawing a platform area topological sketch of an energy-using information acquisition system, which comprises the following operations:
acquiring a data list of a transformer area, a branch box and a meter box in a database, wherein the transformer area, the branch box and the meter box are used for marking a parent-child relationship;
recursively traversing the data list to obtain a tree-shaped json structure data list, adding attributes to each node object in the json structure, and obtaining a json object list with indexes by taking the object ID as the index;
recursively traversing the json structure data list, simulating subsequent traversals of the binary tree to determine node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list;
traversing the json object list to generate a node data list and a character data list, wherein character coordinate information is positioned on the right side of a node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
initializing Canvas, setting the maximum width and height of the Canvas according to data coordinate information, and respectively drawing nodes, characters and connecting lines on three layers of Canvas to finish the drawing of the topology portrait of the transformer area.
Preferably, the attribute added to each node object in the json structure specifically includes: a subset, tree depth, and node rank attributes are added for each node object.
Preferably, the step of determining the coordinates of the nodes from left to right and from bottom to top in the subsequent traversal of the simulated binary tree specifically comprises:
recursively traversing a json structure data list, wherein each traversal adopts traversal from 0 to the last object of the array, and when each node is traversed, whether the node has a subset is judged firstly, the node subset is recurred, all coordinates of the subset are determined, and then the x coordinate of the node is determined;
if the current node has a subset, the x coordinate is the central position of the child node;
if the current node has no subset, determining the x coordinate of the leaf node according to the depth information of the current node;
and updating to the current node coordinate, storing the current node coordinate information into an index object list, recording the latest leaf node and the maximum value of x, updating the current node to be the latest node value of the current node depth, and calculating the y coordinate according to the depth attribute in the object.
Preferably, when the current node is deeper than the previous leaf node, then:
if the x coordinate of the current node is smaller than the x coordinate of the left adjacent node with the current depth, the x coordinate is the sum of the x coordinate of the left adjacent node with the current node depth, the node width and the node distance; otherwise, calculating the difference value between the maximum value of the x coordinate so far and the x coordinate of the left adjacent point with the current depth, if the difference value is not less than half of the occupied width of the subset where the current node is located, taking the node with the maximum value of the x coordinate as the left adjacent point of the father node of the current node, calculating the x coordinate of the current node, and if the difference value is less than half of the occupied width of the subset where the current node is located, the x coordinate is the sum of the x coordinate of the left adjacent point with the current node depth, the node width and the node distance.
Preferably, when the current node is deeper than the previous leaf node, then:
if the difference between the x coordinate of the previous leaf node and the x coordinate of the current depth left adjacent point is less than the width of one node, the x coordinate is the sum of the x coordinate of the current node depth left adjacent point, the width of the node and the distance between the nodes;
otherwise, judging whether the left adjacent point of the same level is the same father node, if the left adjacent point is the same father node, the x coordinate is the sum of the x coordinate of the left adjacent point of the current node depth, the node width and the node distance, and if the left adjacent point is not the same father node, the x coordinate is the x coordinate of the last leaf node.
Preferably, when the current node is the first node, the x coordinate is 0; if the depth is the same as the depth of the last leaf node, the x coordinate is the sum of the x coordinate of the last node, the width of the node and the distance between the nodes.
Preferably, when the current node is not the first leaf node, and the depth is different from the depth of the last leaf node and is not upward or downward, the x coordinate is the sum of the maximum x value and the node width and the node distance.
Preferably, the connection lines include extension lines, bus lines, and branch lines.
Preferably, the x and y coordinates of the extension line are referred to by the current node, and four lines are generated in sequence; the starting point x and y coordinates of the bus are x and y references of a first child node of the current node, the end point is x and y references of a last child node, and the coordinates and the width and the height of a circumscribed rectangle are determined at the same time; the branch lines are connecting lines of the buses connected to each child node, y coordinates are the same, and the x coordinates judge whether the child nodes are located on the left side or the right side of the father node according to the coordinates of each child node.
The invention also provides a system for drawing the topological portrait of the distribution room of the energy consumption information acquisition system, which comprises:
the device data acquisition module is used for acquiring a data list of the transformer, the branch box and the meter box in the transformer area, which are marked with a parent-child relationship in the database;
the object data construction module is used for recursively traversing the data list, acquiring a tree-shaped json structure data list, adding attributes to each node object in the json structure, and acquiring a json object list with indexes by taking an object ID (identity) as an index;
the coordinate acquisition module is used for recursively traversing the json structure data list, simulating the subsequent traversal of the binary tree to determine the node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list;
the drawing object generating module is used for traversing the json object list to generate a node data list and a character data list, and the character coordinate information is positioned on the right side of the node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
and the drawing module is used for initializing Canvas, setting the maximum width and height of the Canvas according to the data coordinate information, and drawing nodes, characters and connecting lines on the three layers of the Canvas respectively to finish the drawing of the topology portrait of the transformer area.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
compared with the prior art, the method has the advantages that the indexed json object list with parent-child relationship is generated by analyzing the associated data of the station area device of the database system, the coordinates of each node are calculated, the method for drawing the topological portrait of the station area based on the Canvas API tool is adopted at the master station end of the system, the image can be automatically formed on the page of the browser, the subordination relationship among various devices, the real-time running state of the devices and the abnormal condition of the line are clearly displayed, the real-time monitoring is realized, the local redrawing efficiency is high, the page is not blocked, redundant and complicated files are not generated, all the files are dynamically loaded on the Canvas object through JavaScript, compared with a table query mode and an SVG drawing mode, the data are more visual, the loading efficiency is higher, and convenience is brought to the system maintainer for monitoring the running condition of the station area.
Drawings
FIG. 1 is a flow chart of a method for drawing a topological profile of a distribution room of an energy-consumption information acquisition system according to an embodiment of the present invention;
FIG. 2 is a flow chart of x coordinate generation provided in an embodiment of the present invention;
fig. 3 is a flowchart of generating leaf node coordinates according to an embodiment of the present invention;
fig. 4 is a block diagram of a region topology sketch rendering system of an energy-consumption information acquisition system according to an embodiment of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
The following describes a method and a system for drawing a distribution room topology sketch of an energy-using information acquisition system in detail with reference to the accompanying drawings.
As shown in fig. 1, the embodiment of the invention discloses a method for drawing a topological portrait of a platform area of an energy-using information acquisition system, which comprises the following operations:
acquiring a data list of a transformer area, a branch box and a meter box in a database, wherein the transformer area, the branch box and the meter box are used for marking a parent-child relationship;
recursively traversing the data list to obtain a tree-shaped json structure data list, adding attributes to each node object in the json structure, and obtaining a json object list with indexes by taking the object ID as the index;
recursively traversing the json structure data list, simulating subsequent traversals of the binary tree to determine node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list;
traversing the json object list to generate a node data list and a character data list, wherein character coordinate information is positioned on the right side of a node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
initializing Canvas, setting the maximum width and height of the Canvas according to data coordinate information, and respectively drawing nodes, characters and connecting lines on three layers of Canvas to finish the drawing of the topology portrait of the transformer area.
The embodiment of the invention is based on Canvas API, data in a system database is inquired and returned to a page through a collection system background data management program, the page processing program processes and integrates the data, horizontal and vertical coordinates of each node, each connecting line and each description character are generated according to a family tree algorithm, canvas finishes drawing a basic graph on the page based on JavaScript, and the distribution condition and the running condition of a transformer and an electric meter box in the current area are visually displayed.
The data object format required by the embodiment of the invention is defined, and the format comprises a unique identifier, a superior node, a node type (transformer/branch box/meter box), a node state (normal/abnormal), states of connecting lines 0, 1, 2 and 3 from a current node to a direct child node, and a contentMap caption (the value is an object, and each key is displayed in a line feed manner).
And requesting a background of the server to return a platform transformer, a branch box and a table box data list with a parent-child relationship of the database by using the AJAX method of jQuery in a JSP page of JavaWeb. The data list has fields in it that indicate parent-child relationships, and the list may be unordered.
And processing a data list returned by the background, performing recursive traversal, generating a multi-layer deep tree json structure with a parent-child attribute from the unordered data list, and adding attributes of child subsets, depth tree depths and index node ranks to each node object. And similarly processing the original data, and acquiring a json object list v _ indexJsonTree with an index by taking the object ID as the index, so that the data can be conveniently searched according to the ID when the drawing object is generated.
Performing recursive traversal again on the tree-shaped json structure, simulating the subsequent traversal of the binary tree to determine the coordinates of the nodes from left to right and from bottom to top, adding coordinate information into the json object list v _ indexJsonTree, and determining the x coordinate in a manner shown in fig. 2:
in each traversal, adopting a json structure obtained by recursion traversal, starting from 0 to traverse to the last object of an array, firstly judging whether the node has a child subset when traversing to each node, determining all coordinates of the subset after the node subset is recursed, and then determining the x coordinate of the node;
if the current node has a subset, the x coordinate is the central position of the child node;
if the current node has no subset, then the leaf node x coordinate is determined according to the following, as shown in FIG. 3:
a. if the current node depth is downward compared with the last operation leaf node, then:
if the x coordinate of the current node is smaller than the x coordinate of the left adjacent node with the current depth, the current node takes the left adjacent point with the current depth as a reference, namely the x coordinate is the sum of the x coordinate of the left adjacent point with the current node depth, the node width and the node distance; otherwise, calculating the maximum value of the x coordinate to the x coordinate of the left adjacent point of the current depth to date, if the difference value is not less than half of the occupied width of the subset of the current node, calculating the coordinate of the current node according to the parent node coordinate of the current node, taking the node with the maximum value of the x coordinate as the left adjacent point of the parent node of the current node, and calculating the x coordinate of the current node, if the difference value is less than half of the occupied width of the subset of the current node, taking the left adjacent point of the current node as the reference;
b. if the node is the first node, x is 0; if the depth of the node is the same as the depth of the last leaf node, the x coordinate is the sum of the x coordinate of the last node, the width of the node and the distance between the nodes;
c. if the current node depth is upward compared with the last operation leaf node, then there are:
if the difference between the x coordinate of the previous leaf node and the x coordinate of the left adjacent point with the current depth is smaller than the width of one node, taking the left adjacent point with the current depth as a reference, namely the x coordinate is the sum of the x coordinate of the left adjacent point with the current node depth, the width of the node and the distance between the nodes; otherwise, judging whether the left adjacent point of the same level is the same father node, if the left adjacent point is the same father node, taking the current depth left adjacent point as a reference, and if the left adjacent point is not the same father node, taking the x coordinate of the last leaf node;
d. for other cases, the x coordinate is the sum of the x maximum and the node width and the node spacing.
Through the steps, the calculation of the x coordinate is completed, and the current node is updated. And storing the coordinate information of the current node into an index object list, recording the latest leaf node and the maximum value of x, updating the current node to be the latest node value of the depth of the current node, and calculating the y coordinate according to the depth attribute in the object.
The embodiment of the invention is used for drawing the portrait, and drawing objects including nodes, characters and connecting lines are respectively stored in three data lists.
Traversing the index object list to generate a node drawing object, wherein the basic attributes of the node drawing object comprise width, length, x coordinate, y coordinate, node type and custom attributes: g represents the drawing canvas to which the shape represents the type of the drawn basic graph. And storing the node drawing object generated after traversal in a node List array.
The method comprises the following steps of simultaneously traversing the contentMap character objects of the nodes when traversing node data, displaying the character objects on the right side of the nodes by taking the current nodes as reference, determining the x and y coordinates of the character area of the current nodes when traversing, displaying each field key and the value in the contentMap character objects as a line, and storing basic attributes comprising texts, x coordinates, y coordinates, maximum text widths, fonts, text alignment, text baselines and text colors and further comprising custom attributes: g represents the drawing canvas to which the shape represents the type of the drawn basic graph. Each contentMap literal object stores the x coordinate, y coordinate, width and height of a circumscribed rectangle, so that local deletion at the later stage is facilitated. The literal objects for all nodes are stored in a literal List array.
And recursively traversing the tree json data list to generate a connecting line drawing object, and determining the coordinates of the connecting line drawing object based on the coordinates of the nodes by adopting the sequence from left to right and from bottom to top. The basic attributes of the connecting line drawing object include line width, color, a starting point x coordinate, a starting point y coordinate, an end point x coordinate, an end point y coordinate, and a custom attribute: g represents the drawing canvas to which the graph belongs, and shape represents the type of the drawn basic graph.
The connection lines are classified into three types, including extension lines, bus lines, and branch lines.
The x and y coordinates of the extension line are referred by the current node, and four lines are generated in sequence; the starting point x and y coordinates of the bus are x and y references of a first child node of the current node, the end point is x and y references of a last child node, and the coordinates and the width and the height of an external rectangle are determined at the same time, so that local clearing at the later stage is facilitated; the branch lines are connecting lines connected to each child node through buses, y coordinates are the same, x coordinates are judged according to the coordinates of each child node, whether the child nodes are located on the left side or the right side of a father node needs to be judged, the arrangement of left side lines is 0-3, and the arrangement of right side lines is 3-0.
Each node corresponds to a combination of a set of extension, bus and branch lines, stored in a List array of connection lines.
In the process of drawing, basic drawing based on Canvas is mainly used. Based on the requirement of local change, in order to ensure the quality and the correctness of graphic display and the efficiency of data loading, data are respectively drawn on three canvases according to types, the three canvases are initialized, the same width and height are set, three data sets are respectively drawn on the respective canvases, and basic drawing based on JavaScript of images, texts and lines of a Canvas API is used for the platform area topology drawing.
According to the method, the device and the system, the association data of the station area of the database system are analyzed, the json object list with indexes and a parent-child relationship is generated, the coordinates of each node are calculated, the method for drawing the topological picture of the station area based on the Canvas API tool is adopted at the master station end of the system, the picture can be automatically drawn on a browser page, the subordination relationships among various devices, the real-time running state of the devices and the abnormal situation of a line are clearly displayed, real-time monitoring is achieved, local redrawing efficiency is high, the page is not blocked, redundant and complicated files do not exist.
As shown in fig. 4, the embodiment of the present invention further discloses a system for drawing a topological sketch of a platform area of an energy consumption information acquisition system, wherein the system comprises:
the device data acquisition module is used for acquiring a data list of the transformer, the branch box and the meter box in the transformer area, which are marked with a parent-child relationship in the database;
the object data construction module is used for recursively traversing the data list, acquiring a tree-shaped json structure data list, adding attributes to each node object in the json structure, and acquiring a json object list with indexes by taking an object ID (identity) as an index;
the coordinate acquisition module is used for recursively traversing the json structure data list, simulating the subsequent traversal of the binary tree to determine the node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list;
the drawing object generating module is used for traversing the json object list to generate a node data list and a character data list, and the character coordinate information is positioned on the right side of the node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
and the drawing module is used for initializing Canvas, setting the maximum width and the maximum height of the Canvas according to the data coordinate information, respectively drawing nodes, characters and connecting lines on the three layers of Canvas, and finishing the drawing of the topological portrait of the transformer area.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (9)

1. A method for drawing a topological portrait of a platform area of an energy-using information acquisition system is characterized by comprising the following operations:
acquiring a data list of a transformer area, a branch box and a meter box in a database, wherein the transformer area, the branch box and the meter box are used for marking a parent-child relationship;
recursively traversing the data list to obtain a tree-shaped json structure data list, adding attributes to each node object in the json structure, and obtaining a json object list with indexes by taking the object ID as the index;
recursively traversing the json structure data list, simulating subsequent traversals of the binary tree to determine node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list; the following traversal of the simulated binary tree from left to right and from bottom to top to determine the node coordinates specifically comprises:
recursively traversing a json structure data list, starting traversal from 0 to the last object of the array in each traversal, firstly judging whether the node has a subset or not when traversing to each node, recursively finishing the node subset, determining all coordinates of the subset, and then determining the x coordinate of the node;
if the current node has the subset, the x coordinate is the central position of the child node;
if the current node has no subset, determining the x coordinate of the leaf node according to the depth information of the current node;
updating to a current node coordinate, storing current node coordinate information into an index object list, recording a latest leaf node and a maximum value of x, updating the current node to be a latest node value of the current node depth, and calculating a y coordinate according to a depth attribute in an object;
traversing the json object list to generate a node data list and a character data list, wherein character coordinate information is positioned on the right side of a node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
initializing Canvas, setting the maximum width and height of the Canvas according to data coordinate information, and respectively drawing nodes, characters and connecting lines on three layers of Canvas to finish the drawing of the topology portrait of the transformer area.
2. The method for drawing the topological representation of the transformer area of the energy consumption information acquisition system according to claim 1, wherein the adding of the attribute to each node object in the json structure specifically comprises: a subset, tree depth, and node rank attribute are added for each node object.
3. The method as claimed in claim 1, wherein when the current node has a downward depth compared to the previous leaf node, there are:
if the x coordinate of the current node is smaller than the x coordinate of the left adjacent node with the current depth, the x coordinate is the sum of the x coordinate of the left adjacent node with the current node depth, the node width and the node distance; otherwise, calculating the difference value between the maximum value of the x coordinate so far and the x coordinate of the left adjacent point of the current depth, if the difference value is not less than half of the occupied width of the subset where the current node is located, taking the node with the maximum value of the x coordinate as the left adjacent point of the father node of the current node, calculating the x coordinate of the current node, and if the difference value is less than half of the occupied width of the subset where the current node is located, the x coordinate is the sum of the x coordinate of the left adjacent point of the current node depth, the node width and the node distance.
4. The method as claimed in claim 1, wherein when the current node has an upward depth compared to the previous leaf node, there are:
if the difference between the x coordinate of the previous leaf node and the x coordinate of the current depth left adjacent point is less than the width of one node, the x coordinate is the sum of the x coordinate of the current node depth left adjacent point, the width of the node and the distance between the nodes;
otherwise, judging whether the left adjacent point of the same level is the same father node, if the left adjacent point is the same father node, the x coordinate is the sum of the x coordinate of the left adjacent point of the current node depth, the node width and the node distance, and if the left adjacent point is not the same father node, the x coordinate is the x coordinate of the previous leaf node.
5. The method for drawing the topological profile of the distribution room of the energy information collection system according to claim 1, wherein when the current node is the first node, the x coordinate is 0; if the depth of the node is the same as the depth of the last leaf node, the x coordinate is the sum of the x coordinate of the last node, the width of the node and the distance between the nodes.
6. The method as claimed in claim 1, wherein when the current node is not the first leaf node, and has a different depth than the previous leaf node, and has a depth not facing up or down, the x coordinate is the sum of the x maximum and the node width and the node distance.
7. The method for mapping the region topology representation of the energy information collection system according to claim 1, wherein the connection lines include extension lines, bus lines and branch lines.
8. The method for drawing the topological map of the distribution room of the energy information acquisition system as claimed in claim 7, wherein the x and y coordinates of the extension line are referenced by the current node to generate four lines in sequence; the starting point x and y coordinates of the bus are x and y references of a first child node of the current node, the end point is x and y references of a last child node, and coordinates and width and height of a circumscribed rectangle are determined simultaneously; the branch lines are connecting lines connected to each child node through buses, y coordinates are the same, and the x coordinates judge whether the child nodes are located on the left side or the right side of the father node according to the coordinates of each child node.
9. A system for mapping a topological representation of a distribution room using an energy information acquisition system, the system comprising:
the equipment data acquisition module is used for acquiring a data list of the transformer, the branch box and the meter box in the transformer area, which are marked with a parent-child relationship in the database;
the object data construction module is used for recursively traversing the data list, acquiring a tree-shaped json structure data list, adding attributes to each node object in the json structure, and acquiring a json object list with indexes by taking an object ID (identity) as an index;
the coordinate acquisition module is used for recursively traversing the json structure data list, simulating the subsequent traversal of the binary tree to determine the node coordinates from left to right and from bottom to top, and adding coordinate information to the json object list; the specific step of determining the coordinates of the nodes from left to right and from bottom to top in the subsequent traversal of the simulated binary tree is as follows:
recursively traversing a json structure data list, starting traversal from 0 to the last object of the array in each traversal, firstly judging whether the node has a subset or not when traversing to each node, recursively finishing the node subset, determining all coordinates of the subset, and then determining the x coordinate of the node;
if the current node has the subset, the x coordinate is the central position of the child node;
if the current node has no subset, determining the x coordinate of the leaf node according to the depth information of the current node;
updating to the current node coordinate, storing the current node coordinate information into an index object list, recording the latest leaf node and the maximum value of x, updating the current node to be the latest node value of the current node depth, and calculating the y coordinate according to the depth attribute in the object;
the drawing object generating module is used for traversing the json object list to generate a node data list and a character data list, and the character coordinate information is positioned on the right side of the node by taking the node coordinate as a basis; traversing the json structure data list, generating a connecting line data list, and determining the coordinates of a connecting line object based on the coordinates of the nodes;
and the drawing module is used for initializing Canvas, setting the maximum width and height of the Canvas according to the data coordinate information, and drawing nodes, characters and connecting lines on the three layers of the Canvas respectively to finish the drawing of the topology portrait of the transformer area.
CN202110722846.6A 2021-06-29 2021-06-29 Energy consumption information acquisition system distribution room topology portrait drawing method and system Active CN113342907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110722846.6A CN113342907B (en) 2021-06-29 2021-06-29 Energy consumption information acquisition system distribution room topology portrait drawing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110722846.6A CN113342907B (en) 2021-06-29 2021-06-29 Energy consumption information acquisition system distribution room topology portrait drawing method and system

Publications (2)

Publication Number Publication Date
CN113342907A CN113342907A (en) 2021-09-03
CN113342907B true CN113342907B (en) 2023-02-21

Family

ID=77481136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110722846.6A Active CN113342907B (en) 2021-06-29 2021-06-29 Energy consumption information acquisition system distribution room topology portrait drawing method and system

Country Status (1)

Country Link
CN (1) CN113342907B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114665887B (en) * 2022-05-24 2022-09-06 成都索贝视频云计算有限公司 JSON character string data compression method based on integral compression
CN115562192B (en) * 2022-09-27 2023-06-27 北京虎蜥信息技术有限公司 Assembly process graphical management method, assembly process graphical management system, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110868319A (en) * 2019-11-08 2020-03-06 北京浪潮数据技术有限公司 Network topology drawing method, device, equipment and readable storage medium
CN111090792A (en) * 2019-08-09 2020-05-01 浙江华云信息科技有限公司 Power distribution network single line diagram automatic mapping method based on weight tree
CN111241348A (en) * 2019-12-31 2020-06-05 浙江华云信息科技有限公司 Method for dynamically adjusting Tree spacing based on Walker's Tree
CN111814281A (en) * 2020-06-22 2020-10-23 积成电子股份有限公司 Automatic drawing method of distribution room topological relation graph based on multi-branch tree hierarchical layout
CN112562032A (en) * 2020-12-21 2021-03-26 长扬科技(北京)有限公司 Method and device for efficiently drawing industrial control network topological graph

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090792A (en) * 2019-08-09 2020-05-01 浙江华云信息科技有限公司 Power distribution network single line diagram automatic mapping method based on weight tree
CN110868319A (en) * 2019-11-08 2020-03-06 北京浪潮数据技术有限公司 Network topology drawing method, device, equipment and readable storage medium
CN111241348A (en) * 2019-12-31 2020-06-05 浙江华云信息科技有限公司 Method for dynamically adjusting Tree spacing based on Walker's Tree
CN111814281A (en) * 2020-06-22 2020-10-23 积成电子股份有限公司 Automatic drawing method of distribution room topological relation graph based on multi-branch tree hierarchical layout
CN112562032A (en) * 2020-12-21 2021-03-26 长扬科技(北京)有限公司 Method and device for efficiently drawing industrial control network topological graph

Also Published As

Publication number Publication date
CN113342907A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
CN113342907B (en) Energy consumption information acquisition system distribution room topology portrait drawing method and system
CN108228183B (en) Front-end interface code generation method and device, electronic equipment and storage medium
US9798310B2 (en) Method for searching cross-regional power supply area based on CIM model and system thereof
CN109190094B (en) Building information model file segmentation method based on IFC standard
CN108108567B (en) Power distribution network single line diagram automatic drawing method based on fault indicator logic position
CN109933311A (en) A kind of information system creation method and relevant apparatus
CN112685570B (en) Multi-label graph-based power grid network frame knowledge graph construction method
CN111125352B (en) Knowledge graph-based associated data visualized data cockpit construction method
CN112232047A (en) Method, system, equipment and medium for multi-dimensional data acquisition and automatic summarization
CN111241646A (en) Layout method of power grid equipment and computer readable storage medium
CN111427988B (en) Method and system for generating regional hierarchical rendering graph and electronic equipment
CN112448829A (en) Network topology display method and device, readable storage medium and intelligent terminal
CN113901231A (en) Method, device and medium for evolution analysis of knowledge graph
CN115438638A (en) Method and system for paging output of table document by tree data
CN115756437A (en) Visual XML data compiling method and system based on SCHEMA file
CN116226487B (en) Data large screen visualization method and system based on pattern recognition
CN116777671A (en) Large-scale energy storage resource management method and system based on automatic topology display generation
CN111275788A (en) Graph synthesis method based on common template graph and differential topological graph
CN114676959A (en) Distribution network graph model management method and device
CN112799669A (en) Method and device for generating application program interface layout code and electronic equipment
CN114936442A (en) System and method for accurately positioning power distribution network equipment and forming topological graph
CN115238428A (en) Transformer substation secondary drawing visual editing digital configuration device, method and application
CN113721823A (en) Human-computer interaction data visualization method based on dragging
CN103679806B (en) Self adaptation visual shell generates method and device
CN111813401A (en) Graphic assembly method and system in drawing modeling tool based on B/S architecture

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