Drawing element processing method and device

By addressing issues such as hidden layers, combined elements, and non-standard coding in nuclear power system flow diagrams, the system achieves element cleaning and coding standardization, improving recognition rate and query efficiency, and supporting rapid and accurate operation in nuclear power plant operation and maintenance.

CN115171145BActive Publication Date: 2026-01-13CNNC NUCLEAR POWER OPERATION MANAGEMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210657834.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2026-01-13
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

There are many non-standard contents in the nuclear power system flow diagrams, such as hidden elements, combined elements and non-standard coding, which leads to low efficiency in locating equipment and pipelines.

Method used

By identifying the canvas coordinate system of the drawing, deleting hidden layers and elements outside the border, breaking down and combining element blocks, and standardizing element codes, the element blocks are processed using a rectangular coordinate system and preset coding rules to achieve element cleaning and coding annotation.

Benefits of technology

It improved the graphic element recognition rate from 50% to over 98%, providing fast and accurate graphic element query and annotation functions, which greatly facilitates nuclear power plant operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115171145B_ABST
    Figure CN115171145B_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the technical field of nuclear power and specifically relates to a kind of drawing graph element processing method and device.The present disclosure realizes the cleaning of graph element by processing various dirty data such as combined graph element scattering, one graph element scattering into multiple graph elements, hidden graph element, boundary outside graph element, and realizes the standardized annotation, warehousing and positioning of code in electronic drawing by recognizing and extracting the text of adjacent graph element.Thus, the present disclosure provides fast and accurate graph element query and annotation function for nuclear power operation and maintenance engineers, greatly facilitates the operation and maintenance work of nuclear power company, and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of nuclear power technology, specifically relating to a method and apparatus for processing drawing elements. Background Technology

[0002] Nuclear power unit systems are extremely complex. Typically, each unit has up to 100,000 pieces of equipment and involves nearly 300 systems (such as the turbine lubrication system, chilled water system, and steam generator blowdown system). Generally, each unit has about 1,000 system flow diagrams, and each system flow diagram contains dozens to more than 300 pieces of equipment and piping.

[0003] In related technologies, electronic drawings of nuclear power system processes are generally stored in DWG and DXF formats. These drawings often contain numerous non-standard elements, leading to difficulties in searching for or incorrectly identifying equipment and piping. For example, there are hidden elements outside the drawing borders, some elements are on hidden layers, there are combined elements, and a single equipment or piping element is split into multiple elements. Furthermore, the coding of equipment or piping elements is often non-standard. These problems significantly increase the workload and reduce the efficiency of finding equipment and piping in electronic drawings. Summary of the Invention

[0004] To overcome the problems existing in related technologies, a method and apparatus for processing drawing elements are provided.

[0005] According to one aspect of the present disclosure, a method for processing drawing elements is provided, the method comprising:

[0006] Step 100: Identify the canvas size of the electronic drawing to be processed, and establish a Cartesian coordinate system for the canvas of the electronic drawing;

[0007] Step 101: If the electronic drawing contains a hidden layer, delete the hidden layer of the electronic drawing;

[0008] Step 102: After step 101, identify the border of the electronic drawing and delete the graphic elements located outside the border on the electronic drawing;

[0009] Step 103: After step 102, identify the combined graphic elements in the electronic drawing and break up the combined graphic elements.

[0010] Step 104: After step 103, determine multiple groups of graphic elements from each non-border graphic element that contains text. Each group of graphic elements contains multiple graphic elements whose distance from each other meets a preset distance condition.

[0011] Step 105: Concatenate the text of each graphic element in each graphic element block group to obtain a temporary code, and determine whether the temporary code conforms to the preset encoding rules.

[0012] Step 106: If the obtained temporary code is determined to conform to the preset encoding rules, the temporary code is used as the final code to replace the text of one of the primitive blocks in the corresponding primitive block group, and the other primitive blocks in the primitive block group are deleted. If the obtained temporary code is determined to not conform to the preset encoding rules, the temporary code is discarded.

[0013] In one possible implementation, step 102 further includes:

[0014] Step 1020: Obtain the system-preset border deviation distance parameter D;

[0015] Step 1021: Determine the primitive whose text value is equal to any Arabic numeral from 1 to 6;

[0016] Step 1022: Obtain n primitives whose x-coordinate X-value deviation is less than X*D from the primitives whose text value is any Arabic numeral from 1 to 6.

[0017] Step 1023: Group the n primitives according to their X values;

[0018] Step 1024: Determine whether the text values ​​of the graphic elements in each group cover 1-6. If it is determined that the text values ​​of the graphic elements in each group cover 1-6, then the n graphic elements are the left and right borders of the electronic drawing.

[0019] In one possible implementation, step 102 further includes:

[0020] Step 1025: Group the n graphic elements according to their X values, where the first group with smaller X values ​​is the left border and the second group with larger X values ​​is the right border.

[0021] Step 1026: Use the X values ​​of the first group as the coordinates of the left border of the electronic drawing, and use the X values ​​of the second group as the coordinates of the right border of the electronic drawing.

[0022] In one possible implementation, step 102 further includes:

[0023] Step 1027: Obtain the system-preset border deviation distance parameter D;

[0024] Step 1028: Determine the primitive whose text value is equal to any one of the English letters AF;

[0025] Step 1029: Obtain m primitives whose ordinate Y-value deviation is less than Y*D from primitives whose text value is equal to any English letter AF;

[0026] Step 10210: Group the m primitives according to their Y values;

[0027] Step 10211: Determine whether the text value of the graphic element in each group covers AF. If it is determined that the text value of the graphic element in each group covers AF, then the m graphic elements are the top and bottom borders of the electronic drawing.

[0028] In one possible implementation, step 102 further includes:

[0029] Step 10212: Group the m primitives according to their Y values, with the third group having the lower border and the fourth group having the upper border.

[0030] Step 10213: Use the Y values ​​of the third group as the coordinates of the bottom border of the electronic drawing, and use the Y values ​​of the fourth group as the coordinates of the top border of the electronic drawing.

[0031] In one possible implementation, step 104 further includes:

[0032] Step 1040: Obtain the system-preset primitive distance parameter E;

[0033] Step 1041: Enumerate all graphic elements in the electronic drawing whose text is arranged in the X direction;

[0034] Step 1042: Traverse the text of each graphic element arranged in the X direction, merge the text of multiple graphic elements whose Y value difference is less than Y*E into temporary codes arranged in the X direction according to the order of the graphic element Y value from large to small, and if the temporary code meets the preset encoding rules, replace the original text of one of the multiple graphic elements with the temporary code, and delete the other graphic elements in the multiple graphic elements.

[0035] In one possible implementation, step 104 further includes:

[0036] Step 1043: Obtain the system-preset primitive distance parameter E;

[0037] Step 1044: Enumerate all graphic elements in the electronic drawing whose text is arranged in the Y direction;

[0038] Step 1045: Traverse the primitives whose text is arranged in the Y direction, merge the text of multiple primitives whose X value difference is less than X*E into temporary codes arranged in the Y direction according to the order of the primitive X value from largest to smallest, and if the temporary code meets the preset encoding rules, replace the original text of one of the primitives with the temporary code, and delete the other primitives in the primitives.

[0039] In one possible implementation, the method further includes:

[0040] Step 107: After processing each graphic element group according to steps 105 and 106, the annotated electronic drawing is obtained.

[0041] Step 108: Convert the annotated electronic drawing into an image file and display it in the user interface. The image file displayed in the user interface can be dragged, scaled, and annotated.

[0042] In one possible implementation, the method further includes:

[0043] Step 109: Based on the correspondence between each electronic drawing and its final code, perform a fuzzy search on each electronic drawing using the input keywords, and display the search results.

[0044] According to another aspect of the present disclosure, a drawing element processing apparatus is provided, the apparatus comprising:

[0045] The canvas recognition module is used to identify the canvas size of the electronic drawing to be processed and to establish a Cartesian coordinate system for the canvas of the electronic drawing.

[0046] The deletion module is used to delete the hidden layers of the electronic drawing when it is detected that the electronic drawing contains hidden layers;

[0047] A border recognition module is used to recognize the border of the electronic drawing and delete the graphic elements located outside the border on the electronic drawing.

[0048] A combination recognition module is used to identify combined graphic elements in the electronic drawing and to break up the combined graphic elements.

[0049] The module determines multiple groups of primitive blocks from each non-bordered primitive block that contains text. Each group of primitive blocks contains multiple primitive blocks whose mutual distance meets a preset distance condition.

[0050] The splicing module is used to splice the text of each graphic element block in each graphic element block group in order to obtain a temporary code, and to determine whether the temporary code conforms to the preset encoding rules.

[0051] The replacement module is used to replace the text of a primitive block in the corresponding primitive block group with the temporary code as the final code if the obtained temporary code is determined to conform to the preset encoding rules, and to delete the other primitive blocks in the primitive block group. If the obtained temporary code is determined to not conform to the preset encoding rules, the temporary code is discarded.

[0052] According to another aspect of the present disclosure, a drawing element processing apparatus is provided, the apparatus comprising:

[0053] processor;

[0054] Memory used to store processor-executable instructions;

[0055] The processor is configured to execute the above-described method.

[0056] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, which, when executed by a processor, implement the above-described method.

[0057] The beneficial effects of this disclosure are as follows: By processing various types of dirty data, such as combined graphic elements being broken down, a single graphic element being dispersed into multiple graphic elements, hidden graphic elements, and graphic elements outside the boundary, this disclosure achieves graphic element cleaning. Furthermore, by recognizing and extracting the quick text of adjacent graphic elements, it achieves standardized labeling, storage, and location of codes in electronic drawings. This provides nuclear power plant operation and maintenance engineers with fast and accurate graphic element query and labeling functions, greatly facilitating the operation and maintenance work of nuclear power companies and improving work efficiency.

[0058] Compared to existing primitive recognition functions based on OCR technology, the recognition rate of this invention can be increased from approximately 50% to over 98%. Compared to primitive search functions based purely on CAD files, the recognition rate can be increased from 80% to over 98%. Attached Figure Description

[0059] Figure 1 This is a flowchart illustrating a drawing element processing method according to an exemplary embodiment.

[0060] Figure 2 This is a flowchart illustrating a drawing element processing method based on an application example.

[0061] Figure 3 This is a block diagram illustrating a drawing element processing apparatus according to an exemplary embodiment. Detailed Implementation

[0062] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] Figure 1 This is a flowchart illustrating a drawing element processing method according to an exemplary embodiment. The method can be executed by a terminal device, which can be a computer; however, this disclosure does not limit the type of terminal device. Figure 1 As shown, the method includes:

[0064] Step 100: Identify the canvas size of the electronic drawing to be processed, and establish a Cartesian coordinate system for the canvas of the electronic drawing;

[0065] Step 101: If the electronic drawing contains a hidden layer, delete the hidden layer of the electronic drawing;

[0066] Step 102: After step 101, identify the border of the electronic drawing and delete the graphic elements located outside the border on the electronic drawing;

[0067] Step 103: After step 102, identify the combined graphic elements in the electronic drawing and break up the combined graphic elements.

[0068] Step 104: After step 103, determine multiple groups of graphic elements from each non-border graphic element that contains text. Each group of graphic elements contains multiple graphic elements whose distance from each other meets a preset distance condition.

[0069] Step 105: Concatenate the text of each graphic element in each graphic element block group to obtain a temporary code, and determine whether the temporary code conforms to the preset encoding rules.

[0070] Step 106: If the obtained temporary code is determined to conform to the preset encoding rules, the temporary code is used as the final code to replace the text of one of the primitive blocks in the corresponding primitive block group, and the other primitive blocks in the primitive block group are deleted. If the obtained temporary code is determined to not conform to the preset encoding rules, the temporary code is discarded.

[0071] This disclosure achieves element cleaning by processing various types of dirty data, such as combined elements, elements splitting a single element into multiple elements, hidden elements, and elements outside the boundary. Furthermore, by recognizing and extracting the quick text of adjacent elements, it enables standardized labeling, storage, and location of codes in electronic drawings. This provides nuclear power plant operation and maintenance engineers with fast and accurate element query and labeling functions, greatly facilitating the operation and maintenance work of nuclear power companies and improving work efficiency.

[0072] Compared to existing primitive recognition functions based on OCR technology, the recognition rate of this invention can be increased from approximately 50% to over 98%. Compared to primitive search functions based purely on CAD files, the recognition rate can be increased from 80% to over 98%.

[0073] In one possible implementation, step 102 further includes:

[0074] Step 1020: Obtain the system-preset border deviation distance parameter D;

[0075] Step 1021: Determine the primitive whose text value is equal to any Arabic numeral from 1 to 6;

[0076] Step 1022: Obtain n primitives whose x-coordinate X-value deviation is less than X*D from the primitives whose text value is any Arabic numeral from 1 to 6.

[0077] Step 1023: Group the n primitives according to their X values;

[0078] Step 1024: Determine whether the text values ​​of the graphic elements in each group cover 1-6. If it is determined that the text values ​​of the graphic elements in each group cover 1-6, then the n graphic elements are the left and right borders of the electronic drawing.

[0079] In one possible implementation, step 102 further includes:

[0080] Step 1025: Group the n graphic elements according to their X values, where the first group with smaller X values ​​is the left border and the second group with larger X values ​​is the right border.

[0081] Step 1026: Use the X values ​​of the first group as the coordinates of the left border of the electronic drawing, and use the X values ​​of the second group as the coordinates of the right border of the electronic drawing.

[0082] In one possible implementation, step 102 further includes:

[0083] Step 1027: Obtain the system-preset border deviation distance parameter D;

[0084] Step 1028: Determine the primitive whose text value is equal to any one of the English letters AF;

[0085] Step 1029: Obtain m primitives whose ordinate Y-value deviation is less than Y*D from primitives whose text value is equal to any English letter AF;

[0086] Step 10210: Group the m primitives according to their Y values;

[0087] Step 10211: Determine whether the text value of the graphic element in each group covers AF. If it is determined that the text value of the graphic element in each group covers AF, then the m graphic elements are the top and bottom borders of the electronic drawing.

[0088] In one possible implementation, step 102 further includes:

[0089] Step 10212: Group the m primitives according to their Y values, with the third group having the lower border and the fourth group having the upper border.

[0090] Step 10213: Use the Y values ​​of the third group as the coordinates of the bottom border of the electronic drawing, and use the Y values ​​of the fourth group as the coordinates of the top border of the electronic drawing.

[0091] In one possible implementation, step 104 further includes:

[0092] Step 1040: Obtain the system-preset primitive distance parameter E;

[0093] Step 1041: Enumerate all graphic elements in the electronic drawing whose text is arranged in the X direction;

[0094] Step 1042: Traverse the text of each graphic element arranged in the X direction, merge the text of multiple graphic elements whose Y value difference is less than Y*E into temporary codes arranged in the X direction according to the order of the graphic element Y value from large to small, and if the temporary code meets the preset encoding rules, replace the original text of one of the multiple graphic elements with the temporary code, and delete the other graphic elements in the multiple graphic elements.

[0095] In one possible implementation, step 104 further includes:

[0096] Step 1043: Obtain the system-preset primitive distance parameter E;

[0097] Step 1044: Enumerate all graphic elements in the electronic drawing whose text is arranged in the Y direction;

[0098] Step 1045: Traverse the primitives whose text is arranged in the Y direction, merge the text of multiple primitives whose X value difference is less than X*E into temporary codes arranged in the Y direction according to the order of the primitive X value from largest to smallest, and if the temporary code meets the preset encoding rules, replace the original text of one of the primitives with the temporary code, and delete the other primitives in the primitives.

[0099] In one possible implementation, the method further includes:

[0100] Step 107: After processing each graphic element group according to steps 105 and 106, the annotated electronic drawing is obtained.

[0101] Step 108: Convert the annotated electronic drawing into an image file and display it in the user interface. The image file displayed in the user interface can be dragged, scaled, and annotated.

[0102] In one possible implementation, the method further includes:

[0103] Step 109: Based on the correspondence between each electronic drawing and its final code, perform a fuzzy search on each electronic drawing using the input keywords, and display the search results.

[0104] Figure 2 This is a flowchart illustrating a method for processing graphic elements in a drawing, based on an application example. For example... Figure 2 As shown, the method for processing drawing elements is as follows:

[0105] S100: Predefined list of equipment and piping values. Defines all list types and values ​​that will appear in equipment and piping codes. List types are generally: unit, system, equipment type, plant, room.

[0106] S200: Equipment and Piping Code Predefined. Defines all possible coding formats for equipment and piping in drawings using regular expressions. For example, the complete coding format for equipment is: 1-digit unit code + 3-digit system code + 3-digit serial number code + 2-digit equipment type code, corresponding to the regular expression: [0-9]{1}[A-Za-z]{1}[0-9]{3}[A-Za-z]{1}. If a drawing contains only one equipment element with the unique code "3-digit serial number code + 2-digit equipment type code," a corresponding regular expression must also be defined for this type of element.

[0107] S300: Definition of annotation style for equipment and piping elements. In order to clearly mark the location of the searched elements on the drawings displayed on the drawing search page, it is necessary to define the annotation style, including the annotation color, shape, and line thickness, such as red, line thickness equal to 5px, circle, or yellow, line thickness equal to 3px, 10*50px rectangle;

[0108] S400: Drawing Upload. Enables the uploading of DWG or DXF format drawings individually or in batches. If the CAD drawing file is in DWG format, it will be automatically converted into a text-based DXF format CAD drawing file.

[0109] S500: Identifies the canvas size of the drawing. It reads and parses the text-formatted DXF file according to the official DXF file format, and reads the canvas size of the drawing from the corresponding segments, denoted as X and Y.

[0110] S600: Delete all hidden layers. The program reads and parses the text-formatted DXF file according to the official DXF file format, locates all layers with the display attribute set to hidden, and deletes those layer segments according to the official DXF file format.

[0111] S700: Border recognition. Based on the algorithm prior to this patent, the top, bottom, left, and right borders of the drawing are identified as MaxY, MinY, MinX, and MaxY, respectively.

[0112] S800: Delete elements outside the border. This includes elements with a Y value greater than the top border value MaxY, elements with a Y value less than the bottom border value MinY, elements with an X value greater than the right border value MinX, and elements with a Y value less than the left border value MinX.

[0113] S900: Identifies combined primitive blocks and breaks them up. It reads and parses DXF files in text format according to the official DXF file format, locates all combined primitive blocks, and directly modifies the DXF file to break them up according to the DXF file format specification.

[0114] S1000: Identify devices and pipelines based on pre-configured information. Identify whether each "multi-line text" in the drawing conforms to the coding specifications predefined in step S200. If it conforms to the corresponding graphic element specification, cache the text content, X-axis, and Y-axis of the graphic element in memory.

[0115] S1100: Devices and pipes that identify multiple graphic elements combined into one graphic element. Based on the algorithm of this patent, two "multi-line text" graphic elements that are close in distance along the X-axis or Y-axis are concatenated into one graphic element. The text content, X-axis, and Y-axis of the concatenated graphic element are then cached in memory.

[0116] S1200: Equipment and piping data import. The text content, X-axis, Y-axis, and drawing file information (such as file code, file name, version, etc.) of the cleaned, spliced, and disassembled, compliant equipment and piping elements cached in memory are written into the database.

[0117] S1300: Fuzzy search for equipment and pipeline keywords. Enables fuzzy search functionality based on text content (i.e., keywords related to equipment and pipelines) within graphical elements.

[0118] S1400: Equipment and piping element annotation. A piece of equipment or piping can appear in multiple drawings. After the user selects a drawing on the search results page, a new element is created in the DXF file (i.e., inserted at the position of a relative paragraph in the text file) according to the DXF file format and the annotation style defined in step S300, such as the red circle.

[0119] S1500: Convert CAD drawings to images. Uses background software to convert DXF drawing files into JPG image files;

[0120] S1600: Web-based online drawing preview with zoom and drag-and-drop functionality. Displays JPG drawings containing searched elements (equipment, piping) on ​​a web page, and utilizes built-in web image preview, zoom, and drag-and-drop features to achieve a drawing preview function similar to that in CAD software.

[0121] In one possible implementation, a drawing element processing apparatus is provided, the apparatus comprising:

[0122] The canvas recognition module is used to identify the canvas size of the electronic drawing to be processed and to establish a Cartesian coordinate system for the canvas of the electronic drawing.

[0123] The deletion module is used to delete the hidden layers of the electronic drawing when it is detected that the electronic drawing contains hidden layers;

[0124] A border recognition module is used to recognize the border of the electronic drawing and delete the graphic elements located outside the border on the electronic drawing.

[0125] The combination recognition module is used to identify combined graphic elements in the electronic drawing and break them apart.

[0126] The determination module is used to traverse each primitive block containing multiple texts, and determine primitive block groups from each primitive block containing multiple texts. Each primitive block group contains multiple adjacent primitive blocks.

[0127] The splicing module is used to splice the text of each graphic element block in each graphic element block group in order to obtain a temporary code, and to determine whether the temporary code conforms to the preset encoding rules.

[0128] The replacement module is used to replace the text of a primitive block in the corresponding primitive block group with the temporary code if it is determined that the obtained temporary code conforms to the preset encoding rules, and delete the other primitive blocks in the primitive block group. If it is determined that the obtained temporary code does not conform to the preset encoding rules, the temporary code is discarded.

[0129] The description of the drawing element processing device has been explained in detail in the drawing element processing method above, and will not be repeated here.

[0130] Figure 3 This is a block diagram illustrating a drawing element processing apparatus according to an exemplary embodiment. For example, apparatus 1900 may be provided as a server. (Refer to...) Figure 3 The apparatus 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.

[0131] Device 1900 may also include a power supply component 1926 configured to perform power management of device 1900, a wired or wireless network interface 1950 configured to connect device 1900 to a network, and an input / output (I / O) interface 1958. Device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or similar.

[0132] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of the device 1900 to perform the above-described method.

[0133] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0134] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0135] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0136] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0137] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0138] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0139] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0141] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method of processing a drawing graphic primitive, characterized by, The method comprises: Step 100, identifying the canvas size of an electronic drawing to be processed, and establishing a rectangular coordinate system for the canvas of the electronic drawing; Step 101, in the case that it is detected that the electronic drawing contains a hidden layer, deleting the hidden layer of the electronic drawing; Step 102, after step 101, identifying the frame of the electronic drawing, and deleting the graphic elements outside the frame on the electronic drawing; Step 103, after step 102, identifying the combined graphic element blocks in the electronic drawing, and dispersing the combined graphic element blocks; Step 104, after step 103, determining a plurality of graphic element block groups from the graphic element blocks which are not frames and contain texts, each of which contains a plurality of graphic element blocks which meet a preset distance condition; Step 105, sequentially splicing the texts of the graphic element blocks in each graphic element block group to obtain a temporary code, and judging whether the temporary code meets a preset coding rule; Step 106, in the case that it is determined that the obtained temporary code meets the preset coding rule, replacing the text of one graphic element block of the graphic element block group with the temporary code as a final code, and deleting the other graphic element blocks of the graphic element block group, and in the case that it is determined that the obtained temporary code does not meet the preset coding rule, abandoning the temporary code.

2. The method of claim 1, wherein, The step 102 further comprises: Step 1020, obtaining a frame deviation distance parameter D preset by the system; Step 1021, determining the graphic elements whose text values are equal to any one of 1-6 Arabic numerals; Step 1022, obtaining n graphic elements whose X value deviations are less than X*D from the graphic elements whose text values are equal to any one of 1-6 Arabic numerals; Step 1023, grouping the n graphic elements according to X values; Step 1024, judging whether the text values of the graphic elements in each group cover 1-6, and if it is determined that the text values of the graphic elements in each group cover 1-6, the n graphic elements are the left and right frames of the electronic drawing.

3. The method of claim 2, wherein, The step 102 further comprises: Step 1025, grouping the n graphic elements according to X values, wherein a first group with small X values is the left frame, and a second group with large X values is the right frame; Step 1026, taking the X value of the first group as the left frame coordinate of the electronic drawing, and taking the X value of the second group as the right frame coordinate of the electronic drawing.

4. The method of claim 1, wherein, The step 102 further comprises: Step 1027, obtaining a frame deviation distance parameter D preset by the system; Step 1028, determining the graphic elements whose text values are equal to any one of A-F English letters; Step 1029, obtaining m graphic elements whose Y value deviations are less than Y*D from the graphic elements whose text values are equal to any one of A-F English letters; Step 10210, grouping the m graphic elements according to Y values; Step 10211, judging whether the text values of the graphic elements in each group cover A-F, and if it is determined that the text values of the graphic elements in each group cover A-F, the m graphic elements are the upper and lower frames of the electronic drawing.

5. The method of claim 4, wherein, The step 102 further comprises: Step 10212, grouping the m graphic elements according to Y values, wherein a third group with small Y values is the lower frame, and a fourth group with large Y values is the upper frame; Step 10213, taking the third group of Y values as the lower border coordinates of the electronic drawing paper and the fourth group of Y values as the upper border coordinates of the electronic drawing paper.

6. The method of claim 1, wherein, The step 104 further comprises: Step 1040, obtaining a system preset primitive distance parameter E; Step 1041, enumerating all text X direction arranged primitives in the electronic drawing paper; Step 1042, traversing each text X direction arranged primitive, merging the texts of multiple primitives with a Y value difference less than Y*E into a temporary code in the order of primitive Y value from large to small, and replacing the original text of one primitive in the multiple primitives with the temporary code and deleting other primitives in the multiple primitives in the case of judging that the temporary code meets the preset coding rule.

7. The method of claim 1, wherein, The step 104 further comprises: Step 1043, obtaining a system preset primitive distance parameter E; Step 1044, enumerating all text Y direction arranged primitives in the electronic drawing paper; Step 1045, traversing each text Y direction arranged primitive, merging the texts of multiple primitives with an X value difference less than X*E into a temporary code in the order of primitive X value from large to small, and replacing the original text of one primitive in the multiple primitives with the temporary code and deleting other primitives in the multiple primitives in the case of judging that the temporary code meets the preset coding rule.

8. The method of claim 1, wherein, The method further comprises: Step 107, obtaining the labeled electronic drawing paper after processing each primitive block group according to the step 105 and the step 106; Step 108, converting the labeled electronic drawing paper into a picture file and displaying the picture file in a user interface, and the picture file displayed in the user interface can be dragged, zoomed and labeled.

9. The method of claim 8, wherein, The method further comprises: Step 109, according to the correspondence between each electronic drawing paper and the final code of the electronic drawing paper, performing fuzzy query on each electronic drawing paper according to the input keyword, and displaying the query result.

10. A graphics primitive processing apparatus, characterized by comprising: The device comprises: A canvas recognition module for recognizing the canvas size of the electronic drawing paper to be processed and establishing a rectangular coordinate system for the canvas of the electronic drawing paper; A deletion module for deleting the hidden layer of the electronic drawing paper in the case of detecting that the electronic drawing paper contains a hidden layer; A border recognition module for recognizing the border of the electronic drawing paper and deleting the primitives outside the border on the electronic drawing paper; A combination recognition module for recognizing the combined primitive blocks in the electronic drawing paper and dispersing the combined primitive blocks; A determination module for determining multiple primitive block groups from the primitive blocks other than the border and containing texts, each primitive block group containing multiple primitive blocks meeting a preset distance condition; A splicing module for splicing the texts of the primitive blocks in each primitive block group in sequence to obtain a temporary code and judging whether the temporary code meets a preset coding rule; A replacement module for replacing the text of one primitive block in the corresponding primitive block group with the temporary code as a final code and deleting other primitive blocks of the primitive block group in the case of judging that the obtained temporary code meets the preset coding rule, and giving up the temporary code in the case of judging that the obtained temporary code does not meet the preset coding rule.

11. A graphics primitive processing apparatus, characterized by comprising: The device comprises: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the method of any one of claims 1 to 9.

12. A non-transitory computer readable storage medium having stored thereon computer program instructions, wherein, the computer program instructions, when executed by a processor, implement the method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Electronic drawing text matching method and apparatus, storage medium and computer device

    CN107315817A

  • Method, device and equipment for processing nuclear power DCS control logic drawing

    CN112861485A