Dwg drawing standardization method and device, computer equipment and storage medium

By obtaining the drawing sheet size, filtering template files, and writing back the title block and detail block content, the problem of the inability to standardize DWG drawing frames was solved, achieving rapid and efficient drawing standardization and improving drawing compliance and traceability.

CN122241787APending Publication Date: 2026-06-19CRRC INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CRRC INFORMATION TECH CO LTD
Filing Date
2026-03-09
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In the existing technology, the drawing frame of DWG drawings cannot be standardized, which makes manual replacement time-consuming, labor-intensive and prone to errors. Existing plugins cannot meet the standardization requirements.

Method used

By obtaining the size of the DWG drawing, filtering template files, determining the content to be extracted based on the title block and detail column positioning items in the template file, and writing it back to the target template file, the drawing frame can be replaced quickly, efficiently, and accurately.

Benefits of technology

It enables rapid, efficient, accurate, and standardized DWG drawings, reducing the investment of manpower and material resources, and improving the compliance and traceability of drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241787A_ABST
    Figure CN122241787A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, computer device, and storage medium for standardizing DWG drawings. The DWG drawing standardization method includes: acquiring a DWG drawing and determining its size; filtering at least one template file based on the size of the DWG drawing; determining a target template file from the at least one template file based on the title block positioning items in the template file; determining the extracted content of the title block and detail block based on the title block positioning items and detail block positioning items recorded in the target template file; and writing back the extracted content of the title block and detail block to the target template file, which enables the rapid, efficient, and accurate replacement of the DWG drawing with the target drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of CAD drawing technology, and more specifically, to a method, apparatus, computer equipment, and storage medium for standardizing DWG drawings. Background Technology

[0002] In the CAD (Computer-Aided Design) technology system, the DWG drawing standardization method is the core application technology for the standardized management and batch editing of engineering drawings, mainly serving fields such as machinery, architecture, electrical, and municipal engineering that require strict adherence to drawing specifications.

[0003] In fields such as engineering design, building construction, and machinery manufacturing, the DWG format, as the core file format of AutoCAD, is the core carrier of design information and the expression of engineering intent. The drawing frame, as the "standardized shell" of DWG drawings, not only contains key management information such as drawing title, number, design unit, scale, and date, but is also a fundamental element ensuring the compliance, consistency, and traceability of drawings. The need to replace DWG drawing frames essentially stems from the adaptation requirement between "standardized design management" and "changes in actual application scenarios."

[0004] In some large enterprises (such as aerospace and automotive manufacturing industries), due to various reasons, the drawing frames of DWG drawings vary widely and cannot meet the standardization requirements. To standardize the drawings, the drawing frames need to be replaced. Currently, the common method is manual replacement of the drawing frames. However, manual replacement requires a lot of manpower, resources, and time, and is prone to errors. Some plugins can perform simple replacements, but they cannot meet the requirements of standardization. Summary of the Invention

[0005] This application provides a method, apparatus, computer equipment, and storage medium for standardizing DWG drawings.

[0006] A first aspect of this application provides a method for standardizing DWG drawings, including: Obtain the DWG drawing and determine the size of the DWG drawing; Filter at least one template file based on the size of the DWG drawing, and determine the target template file from at least one template file based on the title block positioning item in the template file; The content to be extracted from the title bar and detail bar is determined based on the title bar positioning items and detail bar positioning items recorded in the target template file; Write back the extracted content from the title bar and details bar to the target template file.

[0007] In an optional embodiment of this application, determining the size of the DWG drawing includes: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Select the largest rectangle from the set of rectangles, compare the largest rectangle with multiple preset standard rectangles, use the target standard rectangle that matches the largest rectangle as the size of the DWG drawing, and use the size of the target standard rectangle as the size of the DWG drawing.

[0008] In an optional embodiment of this application, the step of filtering at least one template file based on the size of the DWG drawing, and determining the target template file from the at least one template file based on the title block positioning item in the template file, includes: Select at least one template file from multiple template files based on the size of the DWG drawing; For each selected template file, determine whether the current template file matches the DWG drawing based on the title block positioning items and title block position of the current template file; If the current template file matches the DWG drawing, use the current template file as the target template file; If the current template file does not match the DWG drawing, the next template file will be used as the current template file to perform the steps to determine whether the current template file matches the DWG drawing.

[0009] In an optional embodiment of this application, determining the extracted content of the title bar and detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file includes: Based on the title block positioning items and detail block positioning items recorded in the target template file, retrieve the data corresponding to the title block positioning items and detail block positioning items from the DWG drawing, and use them as the extracted content for the title block and detail block.

[0010] In an optional embodiment of this application, the target template file includes a target drawing, a first template corresponding to the DWG drawing, and a second template corresponding to the target drawing. The step of writing back the extracted content of the title block and detail block to the target template file includes: Extract the title block and detail block content from the DWG drawing according to the positions of the title block and detail block positioning items in the first template. Based on the positions of the title block and detail block positioning items recorded in the second template, the extracted content of the title block and detail block from the DWG drawing will be written back to the target drawing.

[0011] In an optional embodiment of this application, the method further includes: Determine the inner frame of the DWG drawing, copy all elements within the inner frame except for the title block and detail block, and paste all elements into the target drawing according to the positions of each element recorded in the second template.

[0012] In an optional embodiment of this application, the inner frame of the DWG drawing is obtained through the following steps: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Sort the rectangles in the rectangle set in descending order, and use the second rectangle as the inner frame of the DWG drawing.

[0013] A second aspect of this application provides a DWG drawing standardization apparatus, comprising: The first determining module is used to acquire DWG drawings and determine the size of the DWG drawings; The filtering module is used to filter at least one template file based on the size of the DWG drawing, and to determine the target template file from at least one template file based on the title block positioning item in the template file. The second determining module is used to determine the content to be extracted from the title bar and the detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file. The write-back module is used to write back the extracted content from the title bar and details bar to the target template file.

[0014] A third aspect of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above DWG drawing standardization methods.

[0015] A fourth aspect of the embodiments of this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the DWG drawing standardization method as described in any of the preceding claims.

[0016] Compared with the prior art, the technical solutions provided in this application have at least some or all of the following advantages: The DWG drawing standardization method described in this application involves: acquiring a DWG drawing and determining its size; selecting at least one template file based on the size of the DWG drawing; determining a target template file from the at least one template file based on the title block positioning items in the template file; determining the extracted content of the title block and detail block based on the title block positioning items and detail block positioning items recorded in the target template file; and writing the extracted content of the title block and detail block back to the target template file. This method enables the rapid, efficient, and accurate replacement of the DWG drawing with the target drawing. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a DWG drawing standardization method provided in one embodiment of this application; Figure 2 A flowchart of a DWG drawing standardization method provided in another embodiment of this application; Figure 3 A flowchart for determining the size of a DWG drawing, provided as an embodiment of this application; Figure 4 A first template schematic diagram provided for one embodiment of this application; Figure 5 A schematic diagram of a second template provided for one embodiment of this application; Figure 6 A schematic diagram of a DWG drawing standardization device provided in one embodiment of this application; Figure 7 This is a schematic diagram of a computer device structure provided in one embodiment of this application. Detailed Implementation

[0018] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0019] Please see Figure 1 and Figure 2 The DWG drawing standardization method provided in this application includes the following steps S100~S400: S100, Obtain DWG drawing and determine the size of the DWG drawing; S200: Select at least one template file based on the size of the DWG drawing, and determine the target template file from at least one template file based on the title block positioning item in the template file; S300, determine the content to be extracted from the title bar and detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file; S400 writes the extracted content from the title bar and detail bar back to the target template file.

[0020] The DWG drawing standardization method proposed in this application can accurately identify, batch replace, or personalize the "drawing frame modules" (including title block, border, signature block, standard annotations, etc.) in DWG format files, and can meet the needs of enterprise standards, industry specifications, or project-specific requirements.

[0021] In an optional embodiment of this application, see [link to relevant documentation]. Figure 3 In step S100, determining the size of the DWG drawing includes: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Select the largest rectangle from the set of rectangles, compare the largest rectangle with multiple preset standard rectangles, use the target standard rectangle that matches the largest rectangle as the size of the DWG drawing, and use the size of the target standard rectangle as the size of the DWG drawing.

[0022] In an optional embodiment of this application, horizontal and vertical lines among all lines are identified by the following steps: Select the horizontal line set HorLines and the vertical line set VerLines, set an error α, and add the line to the corresponding line set if the angle between the line and the horizontal or vertical direction is less than α.

[0023] In an optional embodiment of this application, a rectangle set is obtained by determining the rectangles formed by the horizontal and vertical lines through the following steps: Match a line segment line1 from the HorLines set to the VerLines set. Then match line segment line2, which connects to the start point point1 of line1, and line segment line3, which connects to the end point point2 of line1. The method to determine if they are connected is that point1 connects to either the start point point3 or the end point point4 of line2. Set an error β, that is, if the distance between point1 and point3 is less than β, they are considered connected. In the set of lines HorLines, find line segment line4 that connects to line2 and line3 respectively. Find these four lines and form a rectangle rect1. Add this rectangle to rects. Compare the first rectangle rect1 in the rectangle set rects with the next rectangle rect2 to determine if they contain each other. The comparison method is to compare whether the bottom left corner point rectpoint1 and the top right corner point rectpoint2 of rect1 are inside rectangle rect2. If both points are inside rectangle rect2, then rect2 contains rect1. If one point is inside and the other is outside, then they are considered to intersect. If both points are outside and on opposite sides of rectangle rect2, then rect1 contains rect2. If both points are on one side, then they are considered to be separate. If rect1 contains rect2 or rect2 contains rect1, then these two rectangles are placed in a rectangle set rects1. Similarly, this process is repeated for all rectangles to obtain a rectangle set.

[0024] In an optional embodiment of this application, the largest rectangle is selected from the set of rectangles, the largest rectangle is compared with multiple preset standard rectangles, the target standard rectangle that matches the largest rectangle is used as the drawing size of the DWG drawing, and the size of the target standard rectangle is used as the drawing size of the DWG drawing, including: Get the largest rectangle rectMax in the rectangle set rects1. rectMax is the outermost frame of the map. The second largest rectangle is the inner frame of the map. Obtain the length, width, and height of rectMax, and compare rectMax with the length, width, and height of the standard map sheet in Table 1 below to obtain the size of the map sheet.

[0025] Table 1

[0026] In an optional embodiment of this application, step S200, which involves filtering at least one template file based on the size of the DWG drawing and determining a target template file from the at least one template file based on the title block positioning item in the template file, includes: Select at least one template file from multiple template files based on the size of the DWG drawing; For each selected template file, determine whether the current template file matches the DWG drawing based on the title block positioning items and title block position of the current template file; If the current template file matches the DWG drawing, use the current template file as the target template file; If the current template file does not match the DWG drawing, the next template file will be used as the current template file to perform the steps to determine whether the current template file matches the DWG drawing.

[0027] In an optional embodiment of this application, a template file is defined through the following steps. The template file defines different title bar formats for different companies. The template file specifies the image size, positioning items, title bar position, extracted content, and written-back content.

[0028] In an optional embodiment of this application, determining whether the current template file matches the DWG drawing based on the title block positioning item and title block position of the current template file includes: Retrieve the location item and its relative position from the current template file record. The location item is text. Check if the text exists in the DWG drawing based on the relative position of the record. If it exists, the match is successful; otherwise, continue matching the next template file until a match is successful.

[0029] In an optional embodiment of this application, step S300, determining the extracted content of the title bar and detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file, includes: Based on the title block positioning items and detail block positioning items recorded in the target template file, retrieve the data corresponding to the title block positioning items and detail block positioning items from the DWG drawing, and use them as the extracted content for the title block and detail block.

[0030] In an optional embodiment of this application, the data corresponding to the title bar positioning item and the detail bar positioning item are extracted according to the height of the title bar and the detail bar, respectively.

[0031] In an optional embodiment of this application, the target template file includes a target drawing, a first template corresponding to the DWG drawing, and a second template corresponding to the target drawing. Step S400, which involves writing back the extracted content of the title block and detail block to the target template file, includes: Extract the title block and detail block content from the DWG drawing according to the positions of the title block and detail block positioning items in the first template. Based on the positions of the title block and detail block positioning items recorded in the second template, the extracted content of the title block and detail block from the DWG drawing will be written back to the target drawing.

[0032] In an optional embodiment of this application, the method further includes: Determine the inner frame of the DWG drawing, copy all elements within the inner frame except for the title block and detail block, and paste all elements into the target drawing according to the positions of each element recorded in the second template.

[0033] In an optional embodiment of this application, the inner frame of the DWG drawing is obtained through the following steps: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Sort the rectangles in the rectangle set in descending order, and use the second rectangle as the inner frame of the DWG drawing.

[0034] In an optional embodiment of this application, the first template is template 1 for DWG drawings, and the second template is template 2 for the target drawing. Template 1 defines the drawing size, positioning information, extraction information, title block position, detail block position, etc., as follows: Figure 4 As shown. In Template 2, define the map sheet size, positioning information, write-back information, title block position, detail column position, etc., as follows: Figure 5As shown. In the case of an A3 paper with a DWG drawing size of 297×420, after obtaining the drawing size, the template to be applied is determined as an A3 drawing template. Then, the template 1 file is matched. All templates in the folder are looped through, and the positioning items "Quality" and "Scale" in template 1 are read. In the positioning items, there are relative positions to the lower right corner of the drawing. The position of the text "Quality" in the drawing is a rectangle, with the lower right and upper left corners of the rectangle relative to the lower right corner of the drawing being (166.5, 10) and (175, 15), respectively. The position of the text "Scale" in the drawing is also a rectangle, with the lower right and upper left corners of the rectangle relative to the lower right corner of the drawing being (175, 10) and (180, 15), respectively. Based on the positioning items "Quality" and "Scale," the drawing is searched for the presence of these characters. If they exist, the text is compared to "Quality" and "Scale." If they do, the template file is matched; otherwise, the next template file is matched until all template files are matched. If no match is found, an error message will pop up indicating that a template file was not matched, and the template file needs to be configured. Based on the extraction items in the successfully matched template file 1, extract the information from the title block and detail blocks. Template 1 contains extraction items for the title block such as "Material," "Name," "Code," "Version," and "Title Block." The extraction item "Material" also records the rectangular positions of "Material" relative to the lower right corner of the replacement drawing (-52.5, 15) and (-30, 25). Extracting text from this area yields the attributes of "Material," and this process is repeated to extract all attribute values. Additionally, the extraction item "Title Block" records the lower right corner position (-92.5, 2.5) and upper left corner position (-2.5, 25) of the title block; these positions are used to obtain the drawings of the components within the drawing sheet. Using the same method, the position of the header of the detail column is obtained. For example, the relative position of the extracted item "Serial Number" in the detail column is (0, 0) and (8, 7.1). Therefore, the height of the text area for "Serial Number" is 7.1 and the width is 8. The position of "Serial Number" in the first row of the detail column is calculated as (0, 7.1) and (8, 14.2). The text found within this area is the data for the first row of "Serial Number" in the detail column. This process is repeated for the second, third, and subsequent rows of "Serial Number" data. The same logic applies to obtaining the attribute values ​​of other detail columns. When matching the drawing sheet, the size of the inner frame is known, and the position of the title block is also known in the template. When extracting the detail column, its size can also be calculated. All graphic elements within the inner frame, excluding the title block and detail column, are copied, using the upper left corner of the title block as the base point. Based on the matched drawing sheet size (A3 in this example), the standard A3 drawing can be obtained, along with the corresponding template 2.Template 2 defines the write-back items "Material" and "Name" for the title block. Similar to Template 1, each write-back item also has a relative write-back position, as shown in the figure. The position of the "Material" attribute is (-60, 28) and (-10, 36). The extracted title block "Material" is written back to the standard drawing A3 within this area. Simultaneously, the text height obtained from this area is (36-28) / 2=4. The format of the text in this area of ​​the A3 drawing is also obtained. The text format of the written-back is set, and the "Material" attribute write-back is complete. The other attributes are written back in the same way. Template 2 defines the header information for the write-back items "Serial Number" and "Code" in the details column. For example, the header position of "Serial Number" is (0, 0) and (8, 7.1). Therefore, the text area for "Serial Number" has a height of 7.1 and a width of 8. A rectangle is drawn using the points (0, 7.1) and (8, 14.2). The first row of the "Serial Number" data extracted in section 6.3 is then written back into this rectangle. The text height in this area is (36-28) / 2 = 4. The format of the text in this area of ​​the A3 drawing is also obtained, and the text format is set. Similarly, the other attributes of the first row are written back. This process is repeated until all details column data is written back. The copied elements are pasted into the standard A3 drawing, using the upper left corner of the title block as the base point. The drawing is then saved, completing the drawing standardization process.

[0035] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0036] Please see Figure 6 One embodiment of this application provides a DWG drawing standardization device 600, comprising: The first determining module 610 is used to acquire DWG drawings and determine the size of the DWG drawings; The filtering module 620 is used to filter at least one template file based on the size of the DWG drawing, and to determine the target template file from at least one template file based on the title block positioning item in the template file. The second determining module 630 is used to determine the content to be extracted from the title bar and the detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file. The write-back module 640 is used to write back the extracted content from the title bar and detail bar to the target template file.

[0037] Specific limitations regarding the aforementioned device 600 can be found in the above description of the DWG drawing standardization method, and will not be repeated here. Each module in the aforementioned device 600 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.

[0038] In one embodiment, a computer device is provided, the internal structure of which can be as follows: Figure 7 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a DWG drawing standardization method as described above. It includes: memory and a processor; the memory stores a computer program; and the processor executes the computer program to implement any step of the DWG drawing standardization method described above.

[0039] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, can perform any of the steps in the DWG drawing standardization method described above.

[0040] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0041] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will 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 program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0042] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0043] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0044] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0045] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for standardizing DWG drawings, characterized in that, include: Obtain the DWG drawing and determine the size of the DWG drawing; Filter at least one template file based on the size of the DWG drawing, and determine the target template file from at least one template file based on the title block positioning item in the template file; The content to be extracted from the title bar and detail bar is determined based on the title bar positioning items and detail bar positioning items recorded in the target template file; Write back the extracted content from the title bar and details bar to the target template file.

2. The method according to claim 1, characterized in that, Determining the size of the DWG drawing includes: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Select the largest rectangle from the set of rectangles, compare the largest rectangle with multiple preset standard rectangles, use the target standard rectangle that matches the largest rectangle as the size of the DWG drawing, and use the size of the target standard rectangle as the size of the DWG drawing.

3. The method according to claim 1, characterized in that, The process of selecting at least one template file based on the size of the DWG drawing, and determining the target template file from the at least one template file based on the title block positioning item in the template file, includes: Select at least one template file from multiple template files based on the size of the DWG drawing; For each selected template file, determine whether the current template file matches the DWG drawing based on the title block positioning items and title block position of the current template file; If the current template file matches the DWG drawing, use the current template file as the target template file; If the current template file does not match the DWG drawing, the next template file will be used as the current template file to perform the steps to determine whether the current template file matches the DWG drawing.

4. The method according to claim 1, characterized in that, The step of determining the extracted content of the title bar and detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file includes: Based on the title block positioning items and detail block positioning items recorded in the target template file, retrieve the data corresponding to the title block positioning items and detail block positioning items from the DWG drawing, and use them as the extracted content for the title block and detail block.

5. The method according to claim 1, characterized in that, The target template file includes the target drawing, a first template corresponding to the DWG drawing, and a second template corresponding to the target drawing. The step of writing back the extracted content of the title block and detail block to the target template file includes: Extract the title block and detail block content from the DWG drawing according to the positions of the title block and detail block positioning items in the first template. Based on the positions of the title block and detail block positioning items recorded in the second template, the extracted content of the title block and detail block from the DWG drawing will be written back to the target drawing.

6. The method according to claim 5, characterized in that, The method further includes: Determine the inner frame of the DWG drawing, copy all elements within the inner frame except for the title block and detail block, and paste all elements into the target drawing according to the positions of each element recorded in the second template.

7. The method according to claim 6, characterized in that, The inner frame of the DWG drawing is obtained through the following steps: Iterate through all the lines in the DWG drawing and identify the horizontal and vertical lines among them. Determine the rectangle formed by the horizontal and vertical lines, and obtain the set of rectangles; Sort the rectangles in the rectangle set in descending order, and use the second rectangle as the inner frame of the DWG drawing.

8. A DWG drawing standardization device, characterized in that, include: The first determining module is used to acquire DWG drawings and determine the size of the DWG drawings; The filtering module is used to filter at least one template file based on the size of the DWG drawing, and to determine the target template file from at least one template file based on the title block positioning item in the template file. The second determining module is used to determine the content to be extracted from the title bar and the detail bar based on the title bar positioning items and detail bar positioning items recorded in the target template file. The write-back module is used to write back the extracted content from the title bar and details bar to the target template file.

9. A computer device, comprising: A memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of the DWG drawing standardization method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the DWG drawing standardization method according to any one of claims 1 to 7.