A method, system, terminal, and storage medium for managing drawing information.
By obtaining CAD file objects and label extraction templates in AutoCAD, information within a text range can be automatically extracted, solving the problem of low efficiency in manual information collection in DWG format file management, realizing automated information management, and improving management efficiency.
Patent Information
- Application Number
- CN202211122822.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In existing technologies, the large number of DWG format files generated when using AutoCAD design requires manual collection and management of title block and detail block information, resulting in a large workload and low efficiency.
By acquiring CAD file objects and label extraction templates, the system automatically extracts text within a text range that matches the label text, and determines the corresponding data content based on the data range, thereby achieving automated information management.
It enables the automatic extraction of required information from CAD file objects, reducing manpower and improving the efficiency of drawing information management.
Smart Images

Figure CN115391859B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of computer-aided design, and in particular to a method, system, terminal, and storage medium for managing drawing information. Background Technology
[0002] Currently, engineers typically use AutoCAD for design. Generally, the design process generates a large number of DWG format files. Each file may contain multiple sub-files with different content. To facilitate the management of these DWG files, staff need to collect the title block and detail information from each file, then categorize and store them. However, due to the large volume of data, the workload for staff is significant, and efficiency is low. Summary of the Invention
[0003] The purpose of this application is to provide a method for managing drawing information, which has the feature of automatically extracting the required information.
[0004] The aforementioned objective of this application is achieved through the following technical solution:
[0005] A method for managing drawing information, comprising:
[0006] Obtain a CAD file object, which includes the drawing type, feature point coordinate information, and feature information for each drawn image; if the drawing type is text, then the feature information is the text text, the feature point coordinate information is the text range where the text text is located, and the text text represents label content or data content;
[0007] Obtain a tag extraction template, which includes the tag text, the tag range in which the tag text is located, the data format, and the data range corresponding to the data format;
[0008] Determine the text within the CAD file object whose text range matches the label range and whose text is identical to the label text.
[0009] Extract the corresponding text representation data based on the data range and the text range of the text representation.
[0010] By adopting the above technical solution, text that matches the label range and has the same label wording can be found in the CAD file object. Then, based on the data range and text range, the text corresponding to the aforementioned text in the CAD file object can be further determined, which is the data content to be extracted. Simultaneously, the label wording in the label extraction template is the label content to be extracted. Therefore, the method of this application can automatically extract the required information from the CAD file object corresponding to each drawing file, thereby saving manpower and improving the efficiency of drawing information management.
[0011] Optionally, determining that the text range in the CAD file object conforms to the label range includes:
[0012] The label range includes the first template length and the first template width of the label containing the label text;
[0013] The text range includes the coordinates of the vertices of the range containing the text characters;
[0014] Calculate the actual length and width of the area containing the text based on the vertex coordinates;
[0015] Determine the text range whose actual length is less than the length of the first template and whose actual width is less than the width of the first template.
[0016] Optionally, determining the corresponding text representation data based on the data range and the text range of the text representation includes:
[0017] The data range includes the positional relationship between the data range and the label range, as well as the second template length and the second template width of the data range;
[0018] The actual range of data is determined based on the positional relationship, vertex coordinates, second template length, and second template width.
[0019] Extract text characters representing data whose text range conforms to the true range of the data.
[0020] Optional, also includes:
[0021] The data format includes tabular format and enumeration format, and the data range corresponding to the tabular format is greater than the data range corresponding to the enumeration format.
[0022] If the same label wording is used, and both the tabular and enumerated label extraction templates extract the same text wording, then:
[0023] Based on the matching rules, calculate the matching degree between the text range of the text and the data range corresponding to the table format, and the matching degree between the text range and the data range corresponding to the enumeration format.
[0024] The data format with a high degree of matching with the text range of the given text is determined as the data format corresponding to the given text.
[0025] Optionally, the tag extraction template includes:
[0026] Obtain the desired tag text;
[0027] Retrieve the tag extraction template library, which includes multiple tag extraction templates, each with different tag words, data formats, or corresponding data ranges;
[0028] Extract the corresponding tag extraction template from the tag extraction template library based on the tag text to be extracted.
[0029] By adopting the above technical solution, staff can adjust the extracted labels according to their needs, making this application applicable to a variety of requirements.
[0030] Optional, also includes:
[0031] If the text range in the CAD file object does not match the label range, and / or there is no text with the same wording as the label,
[0032] Then obtain the next tag extraction template to extract the CAD file object again.
[0033] The second objective of this application is to provide a drawing information management system that automatically extracts the required information.
[0034] The second objective of this application is achieved through the following technical solution:
[0035] A drawing information management system, comprising,
[0036] The file acquisition module is used to acquire CAD file objects. The CAD file objects include the drawing type, feature point coordinate information, and feature information of each drawn image. If the drawing type is text, then the feature information is the text text, the feature point coordinate information is the text range where the text text is located, and the text text represents the label content or data content.
[0037] The template acquisition module is used to acquire a tag extraction template, which includes the tag text, the tag range in which the tag text is located, the data format, and the data range corresponding to the data format.
[0038] The search module is used to determine text within the CAD file object whose text range matches the label range and whose text is identical to the label text.
[0039] The extraction module is used to extract the corresponding text characters representing the data based on the data range and the text range of the text characters.
[0040] The third objective of this application is to provide a terminal that has the feature of automatically extracting the required information.
[0041] The aforementioned objective three of this application is achieved through the following technical solution:
[0042] A terminal includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed using the above-described drawing information management method.
[0043] The fourth objective of this application is to provide a computer storage medium capable of storing corresponding programs, which facilitates the automatic retrieval of required information.
[0044] The fourth objective of this application is achieved through the following technical solution:
[0045] A computer-readable storage medium storing a computer program that can be loaded by a processor and executed by any of the above-described drawing information management methods.
[0046] In summary, this application includes at least one of the following beneficial technical effects:
[0047] This application can locate text within a CAD file object whose text range matches the label range and whose text is identical to the label text. Then, based on the data range and text range, it can further determine the text within the CAD file object corresponding to the aforementioned text text, i.e., the data content to be extracted. Simultaneously, the label text in the label extraction template is the label content to be extracted. Therefore, using the method of this application, the required information can be automatically extracted from the CAD file object corresponding to each drawing file, thereby saving manpower and improving the efficiency of drawing information management. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating a drawing information management method according to one embodiment of this application.
[0049] Figure 2 This is a schematic diagram of one specific example of this application.
[0050] Figure 3 This is a schematic diagram of a drawing information management system according to one embodiment of this application.
[0051] Figure 4 This is a schematic diagram of the structure of a smart terminal according to one embodiment of this application.
[0052] In the diagram, 21 is the file acquisition module; 22 is the template acquisition module; 23 is the search module; 24 is the extraction module; 301 is the CPU; 302 is the ROM; 303 is the RAM; 304 is the bus; 305 is the I / O interface; 306 is the input section; 307 is the output section; 308 is the storage section; 309 is the communication section; 310 is the driver; and 311 is the removable media. Detailed Implementation
[0053] The present application will be further described in detail below with reference to the accompanying drawings.
[0054] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0057] This application provides a drawing information management method, mainly used to manage information in drawing files such as DWG format. It has the function of automatically extracting the required information from the drawing file, which can reduce the manpower required to manage drawing information.
[0058] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0059] The main process of the drawing information management method provided in this application embodiment is described as follows.
[0060] like Figure 1 As shown:
[0061] Step S101: Obtain the CAD file object.
[0062] It is understood that CAD file objects are converted from DWG format files through the secondary development interface provided by AutoCAD; that is, one DWG file corresponds to one CAD file object. A CAD file object includes the drawing type, feature point coordinates, and feature information for each drawn image, with a one-to-one correspondence between the drawing type, feature point coordinates, and feature information. The drawn image is the content drawn in the DWG format file corresponding to the CAD file object. In a DWG format file, various graphics, tables, or text may be drawn; each graphic, table, or string of text constitutes a drawn image. Correspondingly, in a CAD file object, if the drawing type is a line segment, the feature point coordinates are the coordinates of the start and end points of the line segment, and the feature information is the line segment length and / or tilt angle; if the drawing type is a rectangle, the feature point coordinates are the coordinates of the four vertices, and the feature information is the length and width of the rectangle; if the drawing type is a circle, the feature point coordinates are the coordinates of the center, and the feature information is the radius; if the drawing type is text, the feature information is the text text itself, and the feature point coordinates are the text area containing the text text. The text range can be determined based on the highest, lowest, leftmost, and rightmost positions of the text. The text range can be represented by the coordinates of the four vertices of the rectangular text box defined by the text. In CAD file objects, text can represent label content or data content.
[0063] Step S102: Obtain the tag extraction template.
[0064] The label extraction template includes the label text, the label range containing the label text, the data format, and the data range corresponding to the data format. The label text is the label content to be extracted from the CAD file object. The label range containing the label text includes the first template length and the first template width, values defined by the staff according to common standards. The data format includes tabular and enumerated formats. In tabular format, the data content corresponding to the label is filled in the table, and its corresponding data range is the area defined by the table. In enumerated format, the data content corresponding to the label is filled in next to the label, and its corresponding data range is the area where the data content can be written. The data range corresponding to the tabular format is larger than the data range corresponding to the enumerated format. Both the data range corresponding to the tabular and enumerated formats include the second template length and the second template width, as well as the positional relationship between the data range and the label range. It is understood that the positional relationship between the label and the data can be different in different DWG format files. Specifically, the data can be to the right of the label. For example, filename: Front view of part A. Here, the filename is the label, and the front view of part A is the data. The data can be below the label. For example,
[0065] file name:
[0066] Front view of part A
[0067] The file name is the label, and the front view of part A is the data.
[0068] Therefore, in a CAD file object, there is a corresponding positional relationship between the text range containing the text representing data content and the text range containing the text representing label content.
[0069] Because the data for each tag in a DWG file is presented in either tabular or enumerated format, a tag extraction template will also include data in one of these formats. That is, there can be two tag extraction templates containing the same tag. Only one tag extraction template should be used at a time.
[0070] It is understood that staff typically need to extract multiple tags and their corresponding data from DWG format files. Therefore, multiple tag extraction templates are required to extract the necessary content. In this application, tag extraction templates are primarily obtained based on the tag text.
[0071] Specifically, the first step is to obtain all the required tag text.
[0072] Next, the tag extraction template library is retrieved. This library contains multiple tag extraction templates. Each template has a different tag wording or data format. When two tag extraction templates have different data formats, the corresponding data ranges also differ.
[0073] Then, since the tag word, tag range, data format, and the corresponding data range are all one-to-one, once the tag word to be extracted is determined, the corresponding tag extraction template can be retrieved from the tag extraction template library based on the tag word. In a specific example, assuming there are three tag words to be extracted, then six tag extraction templates will be selected from the tag extraction template library.
[0074] The tag extraction template library is pre-stored in a memory or other storage device with storage function.
[0075] Step S103: Determine the text in the CAD file object whose text range matches the label range and whose text is the same as the label text.
[0076] The process of extracting the required information from a CAD file object first requires searching for text that matches the label text within the CAD file object. If text matching the label text is found, it is further determined whether the text range containing that text matches the label range. If no text matching the label text is found, it means that the required information cannot be extracted from this DWG format file.
[0077] Furthermore, after finding text identical to the label text, the method for determining whether the text range containing that text text conforms to the label range is as follows: First, determine the actual length and actual width of the text range based on the vertex coordinates of the range containing the text text. For ease of explanation, in this application, the horizontal direction in the DWG format file is defined as the length direction of the text range, and the vertical direction is defined as the width direction of the text range. When the actual length is less than the length of the first template and the actual width is less than the width of the first template, the text range containing that text text is considered to conform to the label range. Conversely, when the actual length is greater than the length of the first template or the actual width is greater than the width of the first template, the text range containing that text text is considered not to conform to the label range. Of course, if the actual length is the same as the length of the first template and the actual width is the same as the width of the first template, then the text range containing that text text is also considered to conform to the label range.
[0078] To facilitate understanding, a concrete example is provided below: When the tag text to be extracted is a filename, its font size is 5. If two text characters with the same filename are found in the CAD file object, but one has a font size of 5 and the other a font size of 4, then the data within the range corresponding to the text character with font size 5 contains the required information, while the data within the range corresponding to the text character with font size 4 does not contain the required information.
[0079] In summary, only when a text field is found within the CAD file object whose text range matches the label range and is identical to the label text, is the text representing the data content within the corresponding data range the required information. If no matching text field is found, the next label extraction template is automatically retrieved for further extraction from the CAD file object.
[0080] Step S104: Extract the corresponding text representation data based on the data range and the text range of the text representation.
[0081] After locating the text that meets the criteria within the CAD file object, the next step is to determine the corresponding data range. The data range is the text area containing the text representing the data content.
[0082] Once a tag extraction template is selected, the data format and the corresponding data range are determined. That is, the positional relationship between the data range and the tag range is also determined. Therefore, the actual data range can be deduced based on the positional relationship between the data range and the tag range in the tag extraction template. Specifically, after finding text that meets the conditions, the vertex coordinates of the four vertices of the text range of that text can be determined. Then, based on the positional relationship between the data range and the tag range, and the second template length and the second template width of the data range, the range of change of the vertex coordinates is calculated to determine the vertex coordinates of the four vertices of the actual data range.
[0083] In a specific example, suppose the vertex coordinates of the four vertices of the text range are (x1, y1), (x1, y2), (x2, y1), and (x2, y2), the data range is to the right of the label range, the length of the second template is a, and the width of the second template is b. Then the vertex coordinates of the actual data range are (x2, y2-b), (x2, y2), (x2+a, y2-b), and (x2+a, y2).
[0084] In another specific example, suppose the vertex coordinates of the four vertices of the text range are (x1, y1), (x1, y2), (x2, y1), and (x2, y2), the data range is below the label range, the length of the second template is a, and the width of the second template is b. Then the vertex coordinates of the actual data range are (x1, y1-b), (x1, y1), (x1+a, y1-b), and (x1+a, y1).
[0085] Of course, there are other positional relationships between the data range and the label range, which will not be listed here. Furthermore, there are multiple methods for calculating the vertex coordinates of the true data range, which will not be elaborated upon here.
[0086] Once the vertex coordinates of the true data range are determined, it is necessary to extract the text characters representing the data that conform to the true data range. The text range mentioned here refers to the text range containing the text characters representing the data content. Only text characters within the true data range constitute the required data content.
[0087] For data in enumerated form, when extracting text representing the data content, one can directly search for text within the CAD file object whose text range matches the actual data range. Specifically, by comparing the vertex coordinates of the four vertices of the text range with the vertex coordinates of the four vertices of the actual data range, the size and positional relationship between the text range and the actual data range can be determined.
[0088] The same method can be used for tabular data. Alternatively, you can choose a step-by-step extraction method to extract the required information, allowing you to finish the extraction process once all data has been extracted. In a specific example, suppose the vertex coordinates of the four vertices of the text range are (x1, y1), (x1, y2), (x2, y1), and (x2, y2), the data range is below the label range, the second template length is 'a', the second template width is 'b', and the width occupied by each line of data is 'c'. Then the actual data range can be divided into multiple sub-regions, in the following order from top to bottom: the vertex coordinates of the first sub-region are (x1, y1-c), (x1, y1), (x1+a, y1-c), and (x1+a, y1); the vertex coordinates of the second sub-region are (x1, y1-2c), (x1, y1-c), (x1+a, y1-2c), and (x1+a, y1-c), ..., and the vertex coordinates of the last sub-region are (x1, y1-b), (x1, y1-b+c), (x1+a, y1-b), and (x1+a, y1-b+c). Then, following a top-to-bottom order, the process searches the CAD file object for text ranges that match the first sub-region, the second sub-region, and so on, until no text range matches any sub-region. At this point, all text ranges matching the actual data range can be quickly extracted, representing the desired data.
[0089] Of course, it's also possible that text with a range matching the actual data range cannot be found. In such cases, it's assumed that the CAD file object does not contain the required data corresponding to that label.
[0090] It is worth noting that if a tag extraction template in the form of an enumeration is used, and a text range corresponding to the text representing the data content is found that satisfies all the above conditions, then it indicates that the extracted text representing the data content is in the form of an enumeration.
[0091] If a label extraction template in tabular form is used, and a text range corresponding to the text representing the data content that meets all the above conditions is found, then it indicates that the extracted text representing the data content is in tabular form.
[0092] If a tag extraction template in tabular form is used, and two text ranges corresponding to text characters representing data content are found that satisfy all the above conditions, then if one of the text ranges matches the text range found using a tag extraction template in enumeration form, it indicates that the data content represented by the text characters within that text range is enumeration-style data. The data content represented by the text characters within the other text range is tabular data.
[0093] If a tag extraction template in tabular form is used, and a text range corresponding to the text representing the data content is found that satisfies all the above conditions, and a tag extraction template in enumeration form also finds the same text range, then it becomes difficult to further determine the data format of the extracted text representing the data content.
[0094] Therefore, further confirmation is needed for the last scenario mentioned above. Specifically, firstly, based on the matching rules, calculate the matching degree between the text range of the given text and the corresponding data range in the table format, and the matching degree between the text range and the corresponding data range in the enumeration format. Then, determine the data format with the higher matching degree to the text range of the given text as the data format corresponding to the given text.
[0095] Furthermore, when calculating the matching degree, it is mainly calculated from two aspects: the text range of the text representing the data content and its area ratio to the data range. Specifically, the area ratio of the text range representing the data content to the data range is: area of the text range representing the data content / area of the data range. It is understood that the extracted text representing the data content may be from multiple lines. Therefore, it is also necessary to determine the positional relationship between the text range of each line of text and the data range. (Refer to...) Figure 2 In a specific example, if the distance *d* between the boundary of the text range and the boundary of the data range for each line of text does not exceed a preset distance, then that line of text can be considered continuous with the next line. If the distance *d* between the boundary of the text range and the boundary of the data range for each line of text is greater than the preset distance, then that line of text can be considered separate from the next line. For the former, the data format corresponding to that text is more likely to be an enumeration; for the latter, the data format corresponding to that text is more likely to be a table. The probability depends on the distance *d* between the boundary of the text range and the boundary of the data range, and the preset distance. The smaller the distance *d*, the greater the probability that the data format corresponding to that text is an enumeration. Conversely, the larger the distance *d*, the greater the probability that the data format corresponding to that text is a table. Of course, the probabilities for the above two cases can also be manually set based on historical data.
[0096] When calculating the area ratio, we obtain the first area similarity between the text range of the given text and the data range in table format, and the second area similarity between the text range of the given text and the data range in list format. When calculating the matching degree of the text content, we obtain the first formal similarity between the text range of the given text and the data range in table format, and the second formal similarity between the text range of the given text and the data range in list format. Then, according to the pre-set weight ratio, we calculate the matching degree for each. In a specific example, if the weight ratio of the area ratio matching degree and the text content matching degree is A:B, then the matching degree of the text range of the given text with the corresponding data range in table format is first area similarity * A + first formal similarity * B, and the matching degree with the corresponding data range in list format is second area similarity * A + second formal similarity * B. Of course, the weight ratio can be adjusted adaptively according to the actual situation.
[0097] In summary, the drawing information management method provided in this application can automatically extract the required information from all DWG format drawing files according to the needs of the staff, thereby facilitating the management of drawing information, saving the manpower required for managing drawing information, and improving management efficiency.
[0098] Figure 3 This application provides a drawing information management system according to one embodiment.
[0099] like Figure 3 The drawing information management system shown includes a file acquisition module 21, a template acquisition module 22, a search module 23, and an extraction module 24, wherein:
[0100] The file acquisition module 21 is used to acquire CAD file objects, which include the drawing type, feature point coordinate information, and feature information of each drawn image; if the drawing type is text, then the feature information is text text, the feature point coordinate information is the text range where the text text is located, and the text text represents label content or data content.
[0101] The template acquisition module 22 is used to acquire a tag extraction template, which includes the tag text, the tag range in which the tag text is located, the data format, and the data range corresponding to the data format.
[0102] The search module 23 is used to determine the text in the CAD file object whose text range matches the label range and is the same as the label text.
[0103] Extraction module 24 is used to extract the text of the corresponding representation data based on the data range and the text range of the text.
[0104] Figure 4A schematic diagram of the structure of a smart terminal suitable for implementing the embodiments of this application is shown.
[0105] like Figure 4 As shown, the smart terminal includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 302 or programs loaded from storage into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0106] The following components are connected to I / O interface 305: an input section 306 including a keyboard, mouse, etc.; an output section 307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to I / O interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 310 as needed so that computer programs read from it can be installed into storage section 308 as needed.
[0107] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 1 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the functions defined in the system of this application.
[0108] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, or any suitable combination thereof.
[0109] 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 this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0110] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including: a file acquisition module 21, a template acquisition module 22, a search module 23, and an extraction module 24. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, the file acquisition module 21 can also be described as "a module for acquiring CAD file objects".
[0111] In another aspect, this application also provides a computer-readable storage medium, which may be included in the smart terminal described in the above embodiments; or it may exist independently and not assembled into the smart terminal. The aforementioned computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the drawing information management method described in this application.
[0112] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.
Claims
1. A method for managing drawing information, characterized in that, include: Obtain a CAD file object, which includes the drawing type, feature point coordinate information, and feature information for each drawn image; If the drawing type is text, then the feature information is the text text, the feature point coordinate information is the text range where the text text is located, and the text text represents the label content or data content; Obtain a tag extraction template, which includes the tag text, the tag range in which the tag text is located, the data format, and the data range corresponding to the data format; Determine the text within the CAD file object whose text range matches the label range and whose text is identical to the label text. Extract the corresponding text representation data based on the data range and the text range of the text representation; Determining that the text range in the CAD file object conforms to the label range includes: The label range includes the first template length and the first template width of the label containing the label text; The text range includes the coordinates of the vertices of the range containing the text characters; Calculate the actual length and width of the area containing the text based on the vertex coordinates; Determine the text range whose actual length is less than the length of the first template and whose actual width is less than the width of the first template.
2. The method according to claim 1, characterized in that, The step of determining the corresponding text representation data based on the data range and the text range of the text representation includes: The data range includes the positional relationship between the data range and the label range, as well as the second template length and the second template width of the data range; The actual range of data is determined based on the positional relationship, vertex coordinates, second template length, and second template width. Extract text characters representing data whose text range conforms to the true range of the data.
3. The method according to claim 1, characterized in that, Also includes: The data format includes tabular format and enumeration format, and the data range corresponding to the tabular format is greater than the data range corresponding to the enumeration format. If the same label wording is used, and both the tabular and enumerated label extraction templates extract the same text wording, then: Based on the matching rules, calculate the matching degree between the text range of the text and the data range corresponding to the table format, and the matching degree between the text range and the data range corresponding to the enumeration format. The data format with a high degree of matching with the text range of the given text is determined as the data format corresponding to the given text.
4. The method according to claim 1, characterized in that, The tag extraction template includes: Obtain the desired tag text; Retrieve the tag extraction template library, which includes multiple tag extraction templates, each with different tag words, data formats, or corresponding data ranges; Extract the corresponding tag extraction template from the tag extraction template library based on the tag text to be extracted.
5. The method according to claim 4, characterized in that, Also includes: If the text range in the CAD file object does not match the label range, and / or there is no text with the same wording as the label, Then obtain the next tag extraction template to extract the CAD file object again.
6. A drawing information management system, characterized in that, include, The file acquisition module (21) is used to acquire CAD file objects, the CAD file objects including the drawing type, feature point coordinate information and feature information of each drawn image; if the drawing type is text, then the feature information is text text, the feature point coordinate information is the text range where the text text is located, and the text text represents the label content or data content; The template acquisition module (22) is used to acquire the tag extraction template, which includes the tag text, the tag range in which the tag text is located, the data format, and the data range corresponding to the data format; The search module (23) is used to determine the text in the CAD file object whose text range matches the label range and is the same as the label text. Extraction module (24) is used to extract the corresponding text characters representing the data based on the data range and the text range of the text characters; Determining that the text range in the CAD file object conforms to the label range includes: The label range includes the first template length and the first template width of the label containing the label text; The text range includes the coordinates of the vertices of the range containing the text characters; Calculate the actual length and width of the area containing the text based on the vertex coordinates; Determine the text range whose actual length is less than the length of the first template and whose actual width is less than the width of the first template.
7. A terminal, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed according to any one of claims 1 to 5.
Citation Information
Patent Citations
Engineering drawing material information extraction method based on template
CN101882225A
Label determination method and device for electronic engineering drawing, storage medium and terminal
CN111460202A