Disclosure of Invention
The purpose of the invention is as follows: aiming at the prior art, the method for converting the OCS drawings of the power grid based on object recognition redrawing is provided, and the OCS drawings of the power grid at different periods are reconstructed and converted.
The technical scheme is as follows: an OCS drawing conversion method for a power grid redrawn based on object recognition comprises the following steps:
step 1: analyzing a drawing file, comprising:
step 1A: judging whether the drawing file is an SVG object, if so, performing the step 1B, otherwise, directly performing the step 2;
step 1B: scanning a drawing paper file to obtain the overall layout of the drawing, and then scanning to determine the number of outgoing lines and incoming lines;
step 1C: extracting all power grid equipment graphic objects, equipment numbers and electrical parameters in the drawing;
step 2: extracting basic graphic elements from a drawing file, combining the basic graphic elements into a power grid equipment graphic object, and adding corresponding electrical parameters;
and step 3: according to the requirements of the OCS drawing of the power grid, under the interactive operation of a drafter, adopting a guide drawing mode to select the closest drawing template, or using a drawing mode and an interactive drawing mode to convert original drawing paper into a new OCS drawing of the power grid according to the obtained graphic object of the power grid equipment;
and 4, step 4: for a new power grid OCS drawing, equipment numbering is carried out, and the two conditions are divided: firstly, directly numbering unnumbered power grid equipment graphic objects, and secondly, replacing the existing equipment numbers; when numbering, automatically numbering the power grid equipment graphic objects according to a pre-established numbering rule database;
and 5: checking and verifying correctness: checking the correctness of the repeated serial numbers, the site names and the topological structures of the drawings according to the requirements of normalization and consistency and the constraint conditions of electric power and voltage, and performing simulation verification on the starting of the equipment;
step 6: and adding mouse event dynamic information association to each power grid equipment graphic object in the power grid OCS drawing for associating electrical parameters, and finally outputting the power grid OCS drawing in an SVG format and storing the power grid OCS drawing in a file or a database.
Has the advantages that: aiming at the problem that a large number of OCS drawings of the power grid at different periods can not be compatible in a power grid operation management mechanism, the invention can identify objects of non-SVG drawings, automatically extract graphic objects of power grid equipment and further reconstruct and convert the graphic objects; after the new OCS drawing of the power grid is converted, the method standardizes the object hierarchy and combination relation of the power grid equipment, and automatically numbers the graphic objects of the power grid equipment according to a pre-established numbering rule database; meanwhile, the method can automatically check the correctness of the drawing, send out danger early warning and error prompt, provide an automatic means for reusing a large number of historical drawings of the power grid in different periods, and greatly improve the efficiency of converting and sharing the OCS drawing.
Detailed Description
The present invention is explained further below.
An OCS drawing conversion method for a power grid redrawn based on object recognition comprises the following steps:
step 1: when converting the primary power grid drawing of DWG, DWF and SVG form into the OCS drawing of SVG, need analyze and extract the object information who contains, and these information are hidden in the figure object, and the drawing file is analyzed and is included:
step 1A: judging whether the drawing file is an SVG object, if so, performing the step 1B, otherwise, directly performing the step 2, and identifying and redrawing the graph and the graphic primitive;
step 1B: scanning a drawing paper file to obtain the overall layout of the drawing, such as a single bus, a double bus and the like, and then scanning to determine the number of outgoing lines and incoming lines;
step 1C: and extracting all power grid equipment graphic objects, equipment numbers and electrical parameters in the drawing, and writing graphic elements into an SVG file or storing the graphic elements into a database by a Blob field.
Step 2: firstly, extracting basic graphic elements from a drawing file, then combining the basic graphic elements into a power grid equipment graphic object, and adding corresponding electrical parameters, wherein the method comprises the following specific steps:
step 2A: dividing a drawing into areas consisting of buses and intervals, wherein the dividing method comprises the steps of breaking vertical intersection, tracking a connecting line (a line connecting primitives moves along with the movement of the primitives), zooming at a fixed point and reconstructing topology (optimizing an organization mode of a graphic object);
and step 2B: carrying out basic graphic element identification; wherein the basic graphic elements comprise points, straight lines, circles, arcs, ellipses;
and step 2C: carrying out similarity matching on the divided and identified basic graphic elements according to standard graphic elements in a graphic library, combining the graphic elements with the best similarity to form graphic element objects of each power grid device, combining all the graphic element objects into power grid device graphic objects according to the type of a power grid drawing and the topological characteristics and the proximity relation, and judging the types of the combined power grid device graphic objects, including a loop, a disconnecting link, a breaker, a transformer and a bus; the type of the power grid drawing comprises a power grid primary side topology drawing or a power grid secondary side topology drawing;
step 2D: and automatically or manually adding the electrical parameters of the primitive objects of the power grid equipment according to the type of the obtained power grid equipment graphic object and the type of the power grid drawing.
And step 3: and according to the requirement of the OCS drawing of the power grid, under the interactive operation of a drafter, adopting a guide drawing mode to select the closest drawing template, or using a drawing mode and an interactive drawing mode to convert the original drawing paper into a new OCS power grid topology drawing according to the obtained power grid equipment graphic object. When the original drawing paper is converted into a new power grid OCS drawing, the method comprises the following specific operations:
a) drawing lines rapidly: drawing a horizontal/vertical line connecting the two points;
b) mirroring: horizontally/vertically turning the power grid equipment graphic object;
c) and (3) replacing the image blocks: replacing the picture blocks in the drawing window in a designated mode;
d) adjusting the wire: adjusting the position of the line in the drawing paper;
e) changing a dotted line: changing a solid routing line into a dotted line in the drawing;
f) and (3) label management: adjusting the font, size and color attributes of the numbering and annotation information in the drawing;
g) the entity operation is as follows: and selecting a plurality of power grid equipment graphic objects in the drawing for combination, decomposition or drawing connection splicing.
And 4, step 4: for a new power grid OCS drawing, equipment numbering is carried out, and the two conditions are divided: firstly, directly numbering unnumbered power grid equipment graphic objects, and secondly, replacing the existing equipment numbers; and when numbering, automatically numbering the power grid equipment graphic objects according to a pre-established numbering rule database.
The specific steps of directly numbering unnumbered power grid equipment graphic objects comprise:
step 4A: numbering the main devices: and numbering the bus: combining the bus voltage grade and the bus serial number; numbering the circuit breakers: according to the numbering rule of the circuit breakers, numbering the circuit breakers by three-digit Arabic numerals in a decimal, quinary or quaternary form; numbering the transformers: combining transformer naming and equipment serial numbers; numbering the motors: combining generator names and equipment serial numbers;
and step 4B: and finding out corresponding naming rules of the slave devices except the main device number in a numbering rule database table according to the device types to form a numbering character string.
And 5: checking and verifying correctness: according to the requirements of normalization and consistency and the constraint conditions of electric power and voltage, checking the correctness of the repeated serial number, the site name and the topological structure of the drawing, and performing simulation verification on the starting of the equipment, the method comprises the following specific steps:
a) and (3) number error correction: traversing a power grid equipment graphic object in a power grid OCS drawing, reading an equipment number, using the equipment number as a key value, storing by using a hash function, and when the same hash value exists in a storage list, indicating that a repeated number exists, and sending a prompt and an alarm;
b) and (3) site name checking: comparing and checking all site and line names with a naming rule base and a basic information base which are established in advance in the whole network;
c) topology checking: checking whether the site topology meets the requirements of connectivity and normalization by establishing a voltage conversion connection rule and a link graph algorithm in a graph theory;
d) and (3) equipment starting simulation, which comprises start-up simulation, line simulation, bus simulation, transformer simulation, current transformer starting simulation and voltage transformer starting simulation, and judging whether the conditions of exceeding the load or the safety range exist.
Step 6: and adding mouse event dynamic information association to each power grid equipment graphic object in the power grid OCS drawing for associating electrical parameters, so that the electrical parameters of a display can be automatically displayed when a certain primitive object is clicked, and finally outputting the power grid OCS drawing in an SVG format and storing the power grid OCS drawing in a file or a database.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.