Two-dimensional drawing primitive information matching method, system and equipment and medium
By constructing an element information matching model and using neural networks to automatically match element and text information, the problem of unstandard labeling of element information in two-dimensional drawings is solved, and the accuracy and efficiency of BIM modeling is improved.
Patent Information
- Application Number
- CN202410908097.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
In the prior art, the text information labeling of the graphic elements in two-dimensional drawings is not standard, which makes it difficult to match the text information corresponding to the graphic elements and the graphic elements, affecting the accuracy of BIM modeling.
By constructing a sample data set obtained from matching primitives and text information, the initial element information matching model is constructed in combination, and the neural network model is used for training to achieve automatic and accurate matching and combination of element information, and the model is optimized to improve matching accuracy.
It improves the accuracy of BIM model flip, reduces the time and energy of manual matching, and enhances the processing capability of the element information matching model.
Smart Images

Figure CN118887682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of drawing processing, and in particular to a method, system, device and medium for matching graphic element information of a two-dimensional drawing. Background Art
[0002] BIM demoulding is the process of converting two-dimensional CAD drawings into three-dimensional BIM models, realizing data integration in the process of building design and construction, ensuring seamless connection between various design and construction stages, and thus helping the building design and construction team to carry out building design and construction more accurately and efficiently. Through BIM demoulding, a model that can be used for design, construction, and operation can be built to achieve a series of goals such as collision checking, quantity calculation and pricing, virtual reality, etc. Therefore, the accuracy of matching the graphics elements in the two-dimensional drawings and the corresponding graphics element information is one of the most important factors affecting the accuracy of demoulding.
[0003] At present, most BIM models are re-modeled using the re-modeling software on the market, but the accuracy of the re-modeling is poor. The main reason is that in order to express a three-dimensional information (height) in a two-dimensional CAD drawing, additional annotation information is needed to supplement the expression. In this way, the annotation information needs to be created very standardly so that the computer can accurately recognize it. However, the text information annotation method of the graphics elements in the drawings is not standardized, and is far from reaching the standard level that can be used for re-modeling. It is difficult to match the graphics elements and the corresponding text information. Generally, manual matching is used, which is not only time-consuming and labor-intensive, but also leads to low re-modeling accuracy.
[0004] Therefore, the present invention aims to provide a method, system, device and medium for matching graphic element information of a two-dimensional drawing to solve the above-mentioned related problems. Summary of the invention
[0005] The technical problem to be solved by the present invention is that in the prior art, due to the non-standard marking of text information of primitives in two-dimensional drawings, it is difficult to match primitives and text information corresponding to the primitives, which affects the accuracy of mold making. The purpose is to provide a method, system, equipment and medium for matching primitive information of two-dimensional drawings. By adopting a sample data set composed of a combination of primitive information obtained by matching primitives and text information corresponding to the primitives, an initial primitive information matching model constructed by combining two neural network models is trained to obtain a primitive information matching model that can accurately match primitives and primitive information. Based on the primitive information matching model, primitives in two-dimensional drawings with irregular and non-standard markings and text information corresponding to the primitives can be automatically and accurately matched and quickly combined, thereby improving the accuracy of mold making and reducing manpower waste.
[0006] The present invention is achieved through the following technical solutions:
[0007] A method for matching graphic element information of a two-dimensional drawing, the method comprising:
[0008] Constructing a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element;
[0009] Constructing an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to the primitive, and a second neural network model for combining the primitive and the text information corresponding to the primitive;
[0010] The sample data set is used to train the initial primitive information matching model to obtain a primitive information matching model capable of completing the matching between primitives and corresponding primitive information;
[0011] The two-dimensional drawing to be annotated is input into the primitive information matching model, and the two-dimensional drawing containing the primitive information combination after primitive information matching is completed is output.
[0012] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0013] Performing error matching detection on the output two-dimensional drawing after matching of the graphic element information, and obtaining an error deviation set of graphic element information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error graphic element information combination;
[0014] Correcting at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination;
[0015] The primitive information matching model is iteratively optimized and trained based on the at least one corrected primitive information combination until an optimal primitive information matching model is obtained.
[0016] Furthermore, the primitive information matching model is iteratively optimized and trained based on the at least one corrected primitive information combination until an optimal primitive information matching model is obtained, specifically:
[0017] Based on the error type of the information error or the matching error, at least one error primitive information combination in the error deviation set is classified to obtain an information error set and a matching error set, wherein the information error set includes at least one first error primitive information combination, and the matching error set includes at least one second error primitive information combination;
[0018] Based on performing error correction on at least one first error primitive information combination, obtaining at least one corrected first error primitive information combination, and based on performing error correction on at least one second error primitive information combination, obtaining at least one corrected second error primitive information combination;
[0019] Iteratively optimizing and training the first neural network model based on the corrected at least one first primitive information combination until an optimal first neural network model is obtained;
[0020] The second neural network model is iteratively optimized and trained based on the at least one corrected second primitive information combination until an optimal second neural network model is obtained.
[0021] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0022] A first model weight and a second model weight are respectively set for characterizing the priorities of the first neural network model and the second neural network model in the primitive information matching model;
[0023] Performing error matching detection on the output two-dimensional drawing after matching of the graphic element information, and obtaining an error deviation set of graphic element information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error graphic element information combination;
[0024] Based on the error type of information error or matching error, at least one error primitive information combination in the error deviation set is classified to obtain an information error set and a matching error set;
[0025] The weights of the first model and the second model are cross-regulated by using the proportions of the comparison information error set and the matching error set in the error deviation set.
[0026] Furthermore, the weights of the first model and the second model are cross-regulated by using the proportions of the comparison information error set and the matching error set in the error deviation set, specifically:
[0027] When the proportion of the information error set in the error deviation set is greater than the proportion of the matching error set in the error deviation set, increasing the weight of the second model;
[0028] When the proportion of the matching error set in the error deviation set is greater than the proportion of the information error set in the error deviation set, the first model weight is increased.
[0029] Furthermore, information errors include text errors, symbol errors and format errors; matching errors include the mismatch between graphic elements and text information.
[0030] The present invention also provides a two-dimensional drawing element information matching system, the system comprising:
[0031] A data set construction module, used to construct a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element;
[0032] A model building module, used to build an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to the primitive, and a second neural network model for combining the primitive and the text information corresponding to the primitive;
[0033] A model training module is used to train the initial primitive information matching model using a sample data set to obtain a primitive information matching model that can complete the matching between primitives and corresponding primitive information;
[0034] The primitive information matching module is used to input the two-dimensional drawing to be annotated into the primitive information matching model, and output the two-dimensional drawing containing the primitive information combination after the primitive information matching is completed.
[0035] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0036] An error matching detection module is used to perform error matching detection on the output two-dimensional drawing after the matching of the primitive information is completed, and obtain an error deviation set of the primitive information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error primitive information combination;
[0037] An error correction module, used for performing error correction on at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination;
[0038] The model optimization module is used to add the corrected at least one primitive information combination into the sample data set to iteratively optimize the primitive information matching model until the optimal primitive information matching model is obtained.
[0039] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above-mentioned methods when executing the computer program.
[0040] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods described above are implemented.
[0041] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0042] In the present invention, by adopting a sample data set composed of a combination of graphic elements and text information corresponding to the graphic elements, an initial graphic element information matching model constructed by combining two neural network models is trained to obtain a graphic element information matching model capable of accurately matching graphic elements and graphic element information. Based on the graphic element information matching model, graphic elements and text information corresponding to the graphic elements in two-dimensional drawings with irregular and non-standard annotations can be automatically and accurately matched and quickly combined, thereby improving the accuracy of mold making and reducing waste of manpower.
[0043] In the present invention, by using the error signal generated by the erroneous combination of graphic element information during the molding process, the graphic element information matching model can be iteratively learned and optimized while personnel are adjusting the drawings, thereby further increasing the matching accuracy of the graphic element information matching model and increasing the ability to handle erroneous information. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:
[0045] Figure 1 This is a schematic diagram of a method flow of a method for matching primitive information of a two-dimensional drawing in this embodiment;
[0046] Figure 2 It is a schematic diagram of a flow chart of an optimization method of a method for matching primitive information of a two-dimensional drawing in this embodiment;
[0047] Figure 3 Schematic diagram of the method flow of step S30 in a method for matching primitive information of a two-dimensional drawing in this embodiment;
[0048] Figure 4 This is a flow chart of a weight control method for a two-dimensional drawing element information matching method in this embodiment;
[0049] Figure 5 This is a schematic diagram of system modules of a two-dimensional drawing element information matching system in this embodiment;
[0050] Figure 6 A schematic diagram of the structure of a computer device. DETAILED DESCRIPTION
[0051] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0052] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0053] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0054] Example 1
[0055] A method for matching graphic element information of a two-dimensional drawing, the method comprising:
[0056] S1: constructing a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element;
[0057] It should be noted that the traditional combination method matches the graphics and the text information corresponding to the graphics entirely through manual judgment and matching, which relies on human judgment of data, is not only time-consuming and labor-intensive but also has a low accuracy rate. In this embodiment, a set of program algorithms and manual screening are developed to match the graphics and the text information corresponding to the graphics, which greatly improves the construction efficiency and the accuracy of matching within the data set during the early sample data set construction process.
[0058] Specifically, in this embodiment, the developed program algorithm logic is as follows: first, the graphic element to be marked is taken as the origin, and a judgment point is defined for each of the multiple text information near the graphic element, and then the distance between the origin and the multiple judgment points is obtained. First, it is determined whether the text information with the closest distance is the text information corresponding to the graphic element. If so, it is matched. If not, it is determined whether the text information with the second closest distance is the text information corresponding to the graphic element, and the judgment is made in sequence. For example, if the text information closest to a beam graphic element is "L200×500", then the width of the two-dimensional rectangular space fitted by the beam graphic element is compared to see whether it is 200. If so, it is considered that the height data of the beam graphic element is 500. If not, the second closest text information is determined. After the match is successful, the CAD built-in Block command is used to combine the graphic element and the corresponding text information into a block element, that is, a graphic element information combination is obtained, in which the name of the block is the text information + a unique ID information. The information of the block can be parsed through the CAD third-party library and can be read by the BIM remodeling software.
[0059] The program algorithm can obtain a two-dimensional drawing with an accuracy rate of about 80%. The two-dimensional drawing is placed in the mold-making software for mold-making processing. A mold-making error signal will be generated during the processing. Based on the mold-making error signal, the matching errors in the two-dimensional drawing are manually modified to obtain a sample data set with an accuracy rate of about 95%.
[0060] S2: constructing an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to the primitive, and a second neural network model for combining the primitive and the text information corresponding to the primitive;
[0061] It should be noted that, in this embodiment, the first neural network model adopts the associative memory artificial neural network model of the discrete Hopfield neural network, the second neural network model adopts the clustering neural network model of the Kohonen network, and the primitive information matching model is a combination of the first neural network model and the second neural network model. The first neural network model is used to accurately identify the text information corresponding to the primitive, and solve the problem of accuracy in identifying text and primitive information. The second neural network model is used to combine the primitive and the text information corresponding to the primitive, and solve the problem of how to reasonably aggregate the text information and the primitive.
[0062] The associative memory process of the Hopfield neural network includes the memory stage and the association stage. In the memory stage, the network stores the memory pattern at a stable equilibrium point (attractor) in the state space by adjusting the weights; in the association stage, the network recovers the complete memory pattern from an incomplete or noisy input through the process of iterative state update; this process is based on the design of the network's energy function and weight matrix, which ensures that the network can stably converge to the correct memory pattern.
[0063] The basic steps of the Kohonen network clustering neural network model algorithm are as follows: First, initialize: randomly initialize the weight vector of each neuron in the network. In the Kohonen network, it usually includes an input layer and a competitive layer (output layer), and the neurons in the competitive layer are arranged in a two-dimensional grid. Determine the number of neurons in the competitive layer, which usually needs to be set according to the clustering requirements of the actual problem. Then perform data preprocessing: normalize the input data to eliminate the order of magnitude difference between different features. Then select the optimal neuron: for each input data sample, calculate the Euclidean distance between it and the weight vector of each neuron in the competitive layer. Select the neuron with the smallest distance as the "winning" neuron, that is, the best matching node for the sample. Then update the weight vector: adjust the weight vector of the winning neuron to make it closer to the weight vector of the input sample; at the same time, according to the neighborhood function and the learning rate, adjust the weight vectors of other neurons within a certain range around the winning neuron so that they are also close to the input sample. Then perform iterative training: repeatedly select the optimal neuron and update the weight vector until the predetermined number of training rounds or convergence conditions are reached (such as the weight change is less than a certain threshold). Finally, the clustering results are output: After training is completed, the neurons on the competition layer will form different cluster centers according to the distribution of their weight vectors, and the input data samples will be assigned to the corresponding clusters according to their distances from each cluster center.
[0064] S3: using the sample data set to train the initial primitive information matching model, to obtain a primitive information matching model that can complete the matching between the primitive and the corresponding primitive information;
[0065] S4: input the two-dimensional drawing to be annotated into the primitive information matching model, and output the two-dimensional drawing containing the primitive information combination after the primitive information matching is completed.
[0066] It should be noted that, in this embodiment, the graphic element information combination in the output two-dimensional drawing is stored in a database, and each graphic element information combination corresponds one-to-one to the data information in the database. When the graphic element information combination needs to be modified, it only needs to be modified in the two-dimensional drawing, and the corresponding data information in the database will be automatically updated and corrected.
[0067] Specifically, in this embodiment, by adopting a sample data set composed of a combination of graphic elements and text information corresponding to the graphic elements, an initial graphic element information matching model constructed by combining two neural network models is trained to obtain a graphic element information matching model capable of accurately matching graphic elements and graphic element information. Based on the graphic element information matching model, graphic elements and text information corresponding to the graphic elements in two-dimensional drawings with irregular and non-standard annotations can be automatically and accurately matched and quickly combined, thereby improving the accuracy of mold making and reducing waste of manpower.
[0068] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0069] S10: performing error matching detection on the output two-dimensional drawing after matching of the primitive information, and obtaining an error deviation set of the primitive information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error primitive information combination;
[0070] It should be noted that, in the present embodiment, error matching detection is performed on the two-dimensional drawing after the output graphic element information matching is completed. The two-dimensional drawing after the output graphic element information matching is input into the mold-making software for mold-making, and the error graphic element information combination of the graphic element information matching error in the two-dimensional drawing is obtained based on the error information output by the mold-making software.
[0071] S20: performing error correction on at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination;
[0072] S30: Iteratively optimizing and training the primitive information matching model based on the at least one corrected primitive information combination until an optimal primitive information matching model is obtained.
[0073] It should be noted that, in this embodiment, the erroneous combination of graphic element information is manually corrected in the two-dimensional drawing, and the data information in the database is automatically updated at the same time. The graphic element information matching model will automatically learn and optimize based on the automatically updated database, and perform repeated iterative training until the erroneous combination of graphic element information no longer appears, that is, the optimal graphic element information matching model is obtained;
[0074] At the same time, it should be noted that to manually correct the erroneous combination of graphic element information in the two-dimensional drawing, you only need to ungroup the erroneous graphic element information combination in the two-dimensional drawing first, then modify the error and recombine it. You can also use CAD quick grouping commands to perform batch modifications to improve the efficiency of modification.
[0075] Furthermore, the primitive information matching model is iteratively optimized and trained based on the at least one corrected primitive information combination until an optimal primitive information matching model is obtained, specifically:
[0076] S310: Classifying at least one error primitive information combination in the error deviation set based on the error type of the information error or the matching error to obtain an information error set and a matching error set, wherein the information error set includes at least one first error primitive information combination, and the matching error set includes at least one second error primitive information combination;
[0077] It should be noted that, in this embodiment, information errors include text errors, symbol errors and format errors; matching errors include the mismatch between graphic elements and text information.
[0078] S320: Based on performing error correction on at least one first error primitive information combination, obtain at least one corrected first error primitive information combination; based on performing error correction on at least one second error primitive information combination, obtain at least one corrected second error primitive information combination;
[0079] S330: performing iterative optimization training on the first neural network model based on the corrected at least one first primitive information combination until an optimal first neural network model is obtained;
[0080] S340: Performing iterative optimization training on the second neural network model based on the at least one corrected second primitive information combination until an optimal second neural network model is obtained.
[0081] Specifically, it should be noted that since the specific roles of the two neural network models in the graphic element information matching model are different, in this embodiment, the erroneous graphic element information combinations are classified according to the error type, and after the erroneous graphic element information combinations of the information error class are corrected, the first neural network model is iteratively optimized and trained, and after the erroneous graphic element information combinations of the matching error class are corrected, the second neural network model is iteratively optimized and trained, so that the two neural network models can be trained more specifically, the training can be faster and more accurate, and it is beneficial to further improve the matching combination of the graphic element information matching model.
[0082] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0083] S40: respectively setting a first model weight and a second model weight for characterizing the priorities of the first neural network model and the second neural network model in the primitive information matching model;
[0084] It should be noted that in the initial primitive information matching model, the first model weight and the second model weight of the first neural network model and the second neural network model are both 50%. The primitive and text information enters the first model in the model, and the two models have the same priority; at the same time, since both the primitive and text information need to be processed by two models, the primitive and text information that first enters the first neural network model will be output to the second neural network model after being processed by the first neural network model; the primitive and text information that first enters the second neural network model will be output to the first neural network model after being processed by the second neural network model.
[0085] S50: performing error matching detection on the output two-dimensional drawing after matching of the primitive information, and obtaining an error deviation set of the primitive information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error primitive information combination;
[0086] S60: Classifying at least one erroneous primitive information combination in the error deviation set based on the error type of the information error or the matching error to obtain an information error set and a matching error set;
[0087] S70: By comparing the proportions of the information error set and the matching error set in the error deviation set, the first model weight and the second model weight are cross-regulated. Specifically, when the proportion of the information error set in the error deviation set is greater than the proportion of the matching error set in the error deviation set, the second model weight is increased; when the proportion of the matching error set in the error deviation set is greater than the proportion of the information error set in the error deviation set, the first model weight is increased.
[0088] Specifically, in this embodiment, if the proportion of erroneous graphic element information combinations in the information error set is relatively large, it means that the processing effect of the first neural network model in the graphic element information matching model is not good and further training and optimization are needed. Therefore, its priority will be lowered during the application process, and the second model weight of the second neural network model will be increased so that the second neural network model will be given priority. If the proportion of erroneous graphic element information combinations in the matching error set is relatively large, the second neural network model will be lowered and the first model weight of the first neural network model will be increased so that the first neural network model will be given priority.
[0089] Example 2
[0090] This embodiment also provides a two-dimensional drawing element information matching system, the system comprising:
[0091] The data set construction module 100 is used to construct a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element;
[0092] A model building module 200, for building an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to a primitive, and a second neural network model for combining a primitive and text information corresponding to the primitive;
[0093] The model training module 300 is used to train the initial primitive information matching model using the sample data set to obtain a primitive information matching model that can complete the matching between the primitive and the corresponding primitive information;
[0094] The primitive information matching module 400 is used to input the two-dimensional drawing to be annotated into the primitive information matching model, and output the two-dimensional drawing containing the primitive information combination after the primitive information matching is completed.
[0095] Furthermore, after the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching completed is output, the method further includes:
[0096] The error matching detection module 500 is used to perform error matching detection on the output two-dimensional drawing after the matching of the primitive information is completed, and obtain an error deviation set of the primitive information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error primitive information combination;
[0097] An error correction module 600 is used to correct the error of at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination;
[0098] The model optimization module 700 is used to add the corrected at least one primitive information combination into the sample data set to perform iterative optimization training on the primitive information matching model until the optimal primitive information matching model is obtained.
[0099] It should be noted that the modules in the system of Example 2 correspond to the steps in the method of Example 1. The steps in the method of Example 1 have been described in detail in Example 1. In this Example 2, the contents of the modules in the system will not be described in detail.
[0100] Example 3
[0101] This embodiment further provides a computer device, including a memory 1005 and a processor 1001, wherein the memory 1005 stores a computer program, and the processor 1001 implements the steps of any one of the above methods when executing the computer program.
[0102] It should be noted that the processor 1001 is used to execute the steps in the above method embodiments according to the instructions in the program code. Alternatively, the processor 1001 implements the functions of each module / unit in the above system / device embodiments when executing the computer program.
[0103] Specifically, in this embodiment, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 1005, and are executed by the processor 1001 to complete the present application. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0104] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor 1001 and a memory 1005. Those skilled in the art will appreciate that this does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include an input / output device 1003, a network access device 1002, a bus 1006, etc.
[0105] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors 1001, digital signal processors 1001 (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 1001 may be a microprocessor or any conventional processor, etc.
[0106] The memory 1005 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 1005 may also be an external storage device 1004 of the terminal device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Further, the memory 1005 may also include both the internal storage unit of the terminal device and the external storage device 1004. The memory 1005 is used to store computer programs and other programs and data required by the terminal device. The memory 1005 may also be used to temporarily store data that has been output or is to be output.
[0107] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] Example 4
[0109] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the above methods are implemented.
[0110] Among them, the computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or any combination of the above. More specific examples of computer readable storage media (a non-exhaustive list) include: an electrical connection with 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), registers, hard disks, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or the above in a suitable combination, or any other form of computer readable storage medium known in the art.
[0111] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). In an embodiment of the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system, or device.
[0112] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for matching primitive information of two-dimensional drawings. It is characterized in that Methods include: Constructing a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element; Constructing an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to the primitive, and a second neural network model for combining the primitive and the text information corresponding to the primitive; The sample data set is used to train the initial primitive information matching model to obtain a primitive information matching model capable of completing the matching between primitives and corresponding primitive information; The two-dimensional drawing to be annotated is input into the primitive information matching model, and the two-dimensional drawing containing the primitive information combination after primitive information matching is completed is output.
2. A method for matching primitive information of a two-dimensional drawing according to claim 1, It is characterized in that After the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching is output, the following steps are also included: Performing error matching detection on the output two-dimensional drawing after matching of the graphic element information, and obtaining an error deviation set of graphic element information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error graphic element information combination; Correcting at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination; The primitive information matching model is iteratively optimized and trained based on the at least one corrected primitive information combination until an optimal primitive information matching model is obtained.
3. The method for matching primitive information of a two-dimensional drawing according to claim 2, It is characterized in that The primitive information matching model is iteratively optimized and trained based on at least one corrected primitive information combination until the optimal primitive information matching model is obtained, specifically: Based on the error type of the information error or the matching error, at least one error primitive information combination in the error deviation set is classified to obtain an information error set and a matching error set, wherein the information error set includes at least one first error primitive information combination, and the matching error set includes at least one second error primitive information combination; Based on performing error correction on at least one first error primitive information combination, obtaining at least one corrected first error primitive information combination, and based on performing error correction on at least one second error primitive information combination, obtaining at least one corrected second error primitive information combination; Iteratively optimizing and training the first neural network model based on the corrected at least one first primitive information combination until an optimal first neural network model is obtained; The second neural network model is iteratively optimized and trained based on the at least one corrected second primitive information combination until an optimal second neural network model is obtained.
4. The method for matching primitive information of a two-dimensional drawing according to claim 1, It is characterized in that After the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching is output, the following steps are also included: A first model weight and a second model weight are respectively set for characterizing the priorities of the first neural network model and the second neural network model in the primitive information matching model; Performing error matching detection on the output two-dimensional drawing after matching of the graphic element information, and obtaining an error deviation set of graphic element information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error graphic element information combination; Based on the error type of information error or matching error, at least one error primitive information combination in the error deviation set is classified to obtain an information error set and a matching error set; The weights of the first model and the second model are cross-regulated by using the proportions of the comparison information error set and the matching error set in the error deviation set.
5. The method for matching the primitive information of a two-dimensional drawing according to claim 4, It is characterized in that The weights of the first model and the second model are cross-regulated by using the proportions of the comparison information error set and the matching error set in the error deviation set, specifically: When the proportion of the information error set in the error deviation set is greater than the proportion of the matching error set in the error deviation set, increasing the weight of the second model; When the proportion of the matching error set in the error deviation set is greater than the proportion of the information error set in the error deviation set, the first model weight is increased.
6. The method for matching primitive information of a two-dimensional drawing according to claim 3, It is characterized in that Information errors include text errors, symbol errors and format errors; matching errors include the mismatch between graphic elements and text information.
7. A matching system based on the method for matching the primitive information of a two-dimensional drawing according to any one of claims 1 to 6, It is characterized in that The system includes: A data set construction module, used to construct a sample data set based on the two-dimensional drawing to be annotated, wherein the sample data set includes a combination of graphic element information obtained by matching the graphic element and the text information corresponding to the graphic element; A model building module, used to build an initial primitive information matching model, wherein the initial primitive information matching model includes a first neural network model for accurately identifying text information corresponding to the primitive, and a second neural network model for combining the primitive and the text information corresponding to the primitive; A model training module is used to train the initial primitive information matching model using a sample data set to obtain a primitive information matching model that can complete the matching between primitives and corresponding primitive information; The primitive information matching module is used to input the two-dimensional drawing to be annotated into the primitive information matching model, and output the two-dimensional drawing containing the primitive information combination after the primitive information matching is completed.
8. The image element information matching system of a two-dimensional drawing according to claim 7, It is characterized in that After the two-dimensional drawing to be annotated is input into the graphic element information matching model and the two-dimensional drawing with the graphic element information matching is output, the following steps are also included: An error matching detection module is used to perform error matching detection on the output two-dimensional drawing after the matching of the primitive information is completed, and obtain an error deviation set of the primitive information matching errors in the two-dimensional drawing, wherein the error deviation set includes at least one error primitive information combination; An error correction module, used for performing error correction on at least one erroneous graphic element information combination to obtain at least one corrected graphic element information combination; The model optimization module is used to add the corrected at least one primitive information combination into the sample data set to iteratively optimize the primitive information matching model until the optimal primitive information matching model is obtained.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
