CAD graphics segmentation method, device, storage medium and electronic device

By reading and using the segmented data associated with CAD graphics for initial and correcting segmentation, the problem of low segmentation accuracy of CAD graphics is solved and higher segmentation accuracy is achieved.

CN119004581BActive Publication Date: 2025-03-28BEIJING EXPLORER SOFTWARE CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411454952.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-03-28
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

In the prior art, the segmentation accuracy of CAD graphics is low, resulting in inaccurate segmentation results.

Method used

By reading the segment data associated with the initial CAD graph from the initial CAD graph to be segmented, the initial segmentation is performed, and the segmentation is corrected when the number of the second segments does not match the number of the first segments until a consistent segmentation result is obtained.

Benefits of technology

It improves the segmentation accuracy of CAD graphics and avoids the problem of inaccurate segmentation results caused by inaccurate recognition of general recognition logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004581B_ABST
    Figure CN119004581B_ABST
Patent Text Reader

Abstract

The present application discloses a segmentation method, device, storage medium and electronic device for CAD graphics, wherein the segmentation method for CAD graphics comprises: reading segmentation data associated with the initial CAD graphics from the initial CAD graphics to be segmented, wherein the segmentation data is used to indicate the first segmentation quantity associated with the initial CAD graphics; performing initial segmentation on the initial CAD graphics to obtain a first CAD graphics with a second segmentation quantity; and performing correction segmentation on the first CAD graphics when the second segmentation quantity is inconsistent with the first segmentation quantity to obtain a second CAD graphics with a first segmentation quantity. The present application solves the technical problem of low segmentation accuracy of CAD graphics in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular, to a segmentation method, device, storage medium and electronic device for CAD graphics. Background Art

[0002] In the related art, the segmentation of CAD graphics is mainly completed automatically through general recognition logic. However, under this operation mode, due to the possibility of inaccurate recognition, the segmentation results obtained are also inaccurate.

[0003] Therefore, there is a problem in the related art that the segmentation accuracy of CAD graphics is low. Summary of the invention

[0004] The embodiments of the present application provide a CAD graphic segmentation method, device, storage medium and electronic device to at least solve the technical problem of low segmentation accuracy of CAD graphics in the related art.

[0005] According to one aspect of an embodiment of the present application, a method for segmenting a CAD graphic is provided, comprising: reading segmentation data associated with an initial CAD graphic to be segmented, wherein the segmentation data is used to indicate a first number of segments associated with the initial CAD graphic; performing initial segmentation on the initial CAD graphic to obtain a first CAD graphic with a second number of segments; and, when the second number of segments is inconsistent with the first number of segments, performing correction segmentation on the first CAD graphic to obtain a second CAD graphic with the first number of segments.

[0006] According to another aspect of an embodiment of the present application, a segmentation device for a CAD graphic is also provided, including: a reading unit, used to read segmentation data associated with the initial CAD graphic to be segmented, wherein the segmentation data is used to indicate a first number of segments associated with the initial CAD graphic; a first segmentation unit, used to perform initial segmentation on the initial CAD graphic to obtain a first CAD graphic with a second number of segments; and a second segmentation unit, used to perform correction segmentation on the first CAD graphic when the second number of segments is inconsistent with the first number of segments to obtain a second CAD graphic with the first number of segments.

[0007] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the segmentation method of the CAD graphic as described above.

[0008] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned CAD graphic segmentation method through the computer program.

[0009] Through the embodiment provided by the present application, after the initial CAD graphic is initially segmented to obtain the first CAD graphic with the second number of segments, the first CAD graphic with the second number of segments is verified based on the first number of segments indicated by the segmentation data associated with the initial CAD graphic. If the second number of segments is inconsistent with the first number of segments, the first CAD graphic is corrected and segmented to obtain the second CAD graphic with the first number of segments. In this way, the defect of inaccurate segmentation results caused by inaccurate recognition of general recognition logic is avoided, thereby achieving the technical effect of improving the segmentation accuracy of CAD graphics. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0012] Figure 1 It is a hardware structure block diagram of a CAD graphics segmentation method according to an embodiment of the present application;

[0013] Figure 2 is a schematic diagram of a segmentation method of a CAD graphic according to an embodiment of the present application;

[0014] Figure 3 is a schematic diagram of a segmentation method of a CAD graphic according to an embodiment of the present application;

[0015] Figure 4 is a schematic diagram of a segmentation method of a CAD graphic according to an embodiment of the present application;

[0016] Figure 5 is a schematic diagram of a segmentation method of a CAD graphic according to an embodiment of the present application;

[0017] Figure 6 is a schematic diagram of a segmentation method of a CAD graphic according to an embodiment of the present application;

[0018] Figure 7is a schematic diagram of a segmentation device for a CAD graphic according to an embodiment of the present invention;

[0019] Figure 8 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a PAM4 signal modulation method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the mapping relationship in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] Optionally, as an optional implementation, as Figure 2 As shown, the segmentation methods of CAD graphics include:

[0026] S202, reading segmentation data associated with the initial CAD graphic to be segmented from the initial CAD graphic, wherein the segmentation data is used to indicate the number of first segments associated with the initial CAD graphic;

[0027] S204, performing initial segmentation on the initial CAD graphic to obtain a second number of segmented first CAD graphics;

[0028] S206: When the second number of segments is inconsistent with the first number of segments, correct and segment the first CAD figure to obtain a second CAD figure with the first number of segments.

[0029] Optionally, in this embodiment, the initial CAD drawing to be segmented may be but is not limited to a CAD drawing displayed in a CAD client, and may be but is not limited to including a beam component, wherein a beam component may be but is not limited to a plurality of beam segments roughly located on a line in the CAD drawing.

[0030] Optionally, in this embodiment, the segmented data associated with the initial CAD graphic can be but is not limited to being determined based on user text information associated with the initial CAD graphic, wherein the user can, but is not limited to, input the user text information associated with the initial CAD graphic when creating the initial CAD graphic, and can, but is not limited to, include the graphic name information, graphic data information and segmented data of the initial CAD graphic.

[0031] To further illustrate, Figure 3 As shown, Figure 3 What is displayed in the figure is user text information associated with a certain CAD graphic, wherein the user text information includes "L2(4)250x600", "L2" in the user text information is used to indicate the graphic name of the CAD graphic, "4" is used to indicate the first segment number associated with the CAD graphic, and "250x600" is used to indicate the graphic data information associated with the CAD graphic.

[0032] It can be understood that the segmentation data is used to indicate the first segmentation quantity associated with the initial CAD graphic, and the first segmentation data is the number of segmentation results that the user expects to obtain after the initial CAD graphic is segmented.

[0033] Optionally, in this embodiment, the initial CAD graphic is initially segmented to obtain a second number of segmented first CAD graphics, and the recognition and segmentation of the CAD graphic may be completed according to, but is not limited to, a general recognition logic.

[0034] Optionally, in this embodiment, when the second number of segments is consistent with the first number of segments, it is determined that it is reasonable to perform the first initial segmentation on the initial CAD drawing, and the first CAD drawing of the second number of segments is determined as the second CAD drawing of the first number of segments.

[0035] Optionally, in this embodiment, when the second number of segments is inconsistent with the first number of segments, it is determined that the first initial segmentation of the initial CAD drawing is unreasonable, and segmentation correction is required based on the first CAD drawing obtained by the first initial segmentation to obtain a second CAD drawing with the first number of segments.

[0036] Optionally, in this embodiment, the case where the second segment number is inconsistent with the first segment number may include, but is not limited to, a case where the second segment number is less than the first segment number and a case where the second segment number is less than the first segment number.

[0037] It is understandable that, when the second number of segments is less than the first number of segments, it is determined that the segmentation result obtained by the first initial segmentation indicates that the number of segments is small, and further splitting and segmenting processing is required based on the first CAD figure.

[0038] Also, when the second segment number is smaller than the first segment number, it is determined that the segmentation result obtained by the first initial segmentation indicates that the number of segments is too large, and further merging and segmenting processing is required based on the first CAD drawing.

[0039] Through the embodiment provided by the present application, after the initial CAD graphic is initially segmented to obtain the first CAD graphic with the second number of segments, the first CAD graphic with the second number of segments is verified based on the first number of segments indicated by the segmentation data associated with the initial CAD graphic. If the second number of segments is inconsistent with the first number of segments, the first CAD graphic is corrected and segmented to obtain the second CAD graphic with the first number of segments. In this way, the defect of inaccurate segmentation results caused by inaccurate recognition of general recognition logic is avoided, thereby achieving the technical effect of improving the segmentation accuracy of CAD graphics.

[0040] As an optional solution, when the second number of segments is inconsistent with the first number of segments, correcting and segmenting the first CAD drawing to obtain the second CAD drawing with the first number of segments includes:

[0041] In a case where the second segment number is less than the first segment number, determining at least one first node style template matching a first graphic area of ​​the first CAD graphic from a node style template set, wherein the first graphic area corresponds to a segmentation result of the first CAD graphic;

[0042] Using the at least one first node style template, splitting the first graphic area to obtain the first number of segmented second CAD graphics;

[0043] In a case where the second number of segments is greater than the first number of segments, determining at least one second node style template matching a second graphic region of the first CAD graphic from the node style template set, wherein the second graphic region corresponds to at least two segmentation results of the first CAD graphic;

[0044] The second graphic areas are merged using the at least one second node style template to obtain the second CAD graphics of the first number of segments.

[0045] Optionally, in this embodiment, when the second number of segments is less than the first number of segments, it is determined that the segmentation result obtained by the first initial segmentation indicates that the number of segments is small, and further splitting and segmenting processing is required based on the first CAD figure.

[0046] It should be noted that before the splitting and segmenting process is performed, at least one first node style template matching the first graphic area of ​​the first CAD graphic is determined from the node style template set.

[0047] Optionally, in this embodiment, the node style template set is a pre-established standard template for splitting or merging. It is understandable that, when there is a graphic area consistent with a certain node style template in the first CAD graphic, the graphic area can be split or merged according to the splitting or merging requirements with reference to the node position information of the node style template, but is not limited to.

[0048] To further illustrate, Figure 4 As shown, the pre-established node style template set includes a1-type node style template, a2-type node style template, a3-type node style template, and, as Figure 5 As shown, the b1-type node style template, b2-type node style template, and b3-type node style template included in the pre-established node style template set. Among them, different types of node style templates correspond to different connection types and / or connection methods, and different types of node style templates correspond to different priorities, that is, the node style template with a high priority is used first to match the first CAD drawing to determine whether it is the node style template required for the current splitting or merging requirements of the first CAD drawing. To further illustrate, as shown in the a1-type node style template, beams 1 and 2 in the horizontal direction on the left and right sides of the node are beam segments to be corrected.

[0049] Optionally, in this embodiment, when at least one first node style template matching the first graphic area of ​​the first CAD graphic is determined from the node style template set, the first graphic area is split using the at least one first node style template to obtain the second CAD graphic with the first number of segments.

[0050] It should be noted that after each match, a splitting process is performed to obtain the number of segments included in the new CAD graphic plus one, and on this basis, it is determined whether the number of segments of the new CAD graphic is consistent with the number of segments of the first graphic. If they are consistent, the splitting correction is completed to obtain the second CAD graphic with the first number of segments. If they are inconsistent, based on the new CAD graphic, the next node style template is matched with reference to the priority, and the next splitting process is performed.

[0051] Also, when the second segment number is smaller than the first segment number, it is determined that the segmentation result obtained by the first initial segmentation indicates that the number of segments is too large, and further merging and segmenting processing is required based on the first CAD drawing.

[0052] It should be noted that before the splitting and segmenting process is performed, at least one second node style template matching the second graphic area of ​​the first CAD graphic is determined from the node style template set.

[0053] Optionally, in this embodiment, the node style template set is a pre-established standard template for splitting or merging. It is understandable that, when there is a graphic area consistent with a certain node style template in the first CAD graphic, the graphic area can be split or merged according to the splitting or merging requirements with reference to the node position information of the node style template, but is not limited to.

[0054] Optionally, in this embodiment, when at least one second node style template matching the second graphic area of ​​the first CAD graphic is determined from the node style template set, the second graphic area is merged using the at least one second node style template to obtain the second CAD graphic of the first number of segments.

[0055] It should be noted that after each match, a merge process is performed to obtain the number of segments included in the new CAD graphic minus one, and on this basis, it is determined whether the number of segments of the new CAD graphic is consistent with the number of segments of the first CAD graphic. If they are consistent, the merge correction is completed to obtain the second CAD graphic with the first number of segments. If they are inconsistent, based on the new CAD graphic, the next node style template is matched with reference to the priority, and the next merge process is performed.

[0056] Through the embodiments provided by the present application, if the number of second segments is less than the number of first segments, the first CAD drawing is split and corrected to obtain the second CAD drawing with the first number of segments; if the number of second segments is greater than the first number of segments, the first CAD drawing is merged and corrected to obtain the second CAD drawing with the first number of segments; in this way, the defect of inaccurate segmentation results caused by inaccurate recognition of general recognition logic is avoided, thereby achieving the technical effect of improving the segmentation accuracy of CAD graphics.

[0057] As an optional solution, determining at least one first node style template matching the first graphic area of ​​the first CAD graphic from the node style template set includes:

[0058] Acquire a first node style template with the highest splitting priority from the node style templates;

[0059] Use the first node style template with the highest priority to compare with each segmentation result from left to right of the first CAD graphic to match and determine the first graphic area with the same style;

[0060] The step of using the at least one first node style template to split the first graphic area to obtain the first number of segmented second CAD graphics includes:

[0061] Determine, based on the first node position of the first node style template with the highest priority, the second node position corresponding to the first graphic area;

[0062] Splitting the first graphic area at the second node position to obtain a third CAD graphic with a third number of segments;

[0063] When the number of the third segments is less than the number of the first segments, continue to obtain the unused first node style template with the highest splitting priority from the node style template, and split the third CAD figure until the second CAD figure with the first number of segments is obtained;

[0064] In a case where the third number of segments is equal to the first number of segments, the third CAD figure is determined as the second CAD figure.

[0065] Optionally, in this embodiment, the first node style template with the highest splitting priority is first obtained from the node style templates, and the first node style template with the highest priority is used to compare with each segmentation result from left to right of the first CAD graphic to match and determine the first graphic area with consistent style.

[0066] It can be understood that the first node style template is taken out in sequence according to the splitting priority order, and compared with each node of the current first CAD graphic from left to right. When the styles match, the splitting is performed.

[0067] It should be noted that after each match, a splitting process is performed to obtain the number of segments included in the new CAD graphic plus one, and on this basis, it is determined whether the number of segments of the new CAD graphic is consistent with the number of segments of the first graphic. If they are consistent, the splitting correction is completed to obtain the second CAD graphic with the first number of segments. If they are inconsistent, based on the new CAD graphic, the next node style template is matched with reference to the priority, and the next splitting process is performed.

[0068] As an optional solution, determining at least one second node style template matching the second graphic area of ​​the first CAD graphic from the node style template set includes:

[0069] Acquire a second node style template with the highest merging priority from the node style templates;

[0070] Using the second node style template with the highest priority, compare with at least two segmentation results of the second CAD graphic from left to right, so as to match and determine the second graphic area with the same style;

[0071] The step of using the at least one second node style template to merge the second graphic areas to obtain the first segmented number of second CAD graphics includes:

[0072] Determining a fourth node position corresponding to the second graphic area based on the third node position of the second node style template with the highest priority;

[0073] Merging the second graphic regions at the fourth node position to obtain fourth CAD graphics of a fourth number of segments;

[0074] When the number of the fourth segments is greater than the number of the first segments, continue to obtain unused second node style templates with the highest merging priority from the node style templates, and perform merging processing on the fourth CAD graphics until the second CAD graphics with the first number of segments are obtained;

[0075] When the fourth segment number is equal to the first segment number, the fourth CAD figure is determined as the second CAD figure.

[0076] Optionally, in this embodiment, a second node style template with the highest splitting priority is first obtained from the node style template, and the second node style template with the highest priority is used to compare with every two segmentation results from left to right of the second CAD graphic to match and determine the second graphic area with consistent style.

[0077] It can be understood that the second node style templates are taken out in sequence according to the splitting priority order, and compared with the nodes of the current second CAD graphic from left to right. When the styles match, the merge is performed.

[0078] It should be noted that after each match, a merge process is performed to obtain the number of segments included in the new CAD graphic minus one, and on this basis, it is determined whether the number of segments of the new CAD graphic is consistent with the number of segments of the first CAD graphic. If they are consistent, the merge correction is completed to obtain the second CAD graphic with the first number of segments. If they are inconsistent, based on the new CAD graphic, the next node style template is matched with reference to the priority, and the next merge process is performed.

[0079] As an optional solution, the step of reading the segmentation data associated with the initial CAD graphic to be segmented includes:

[0080] Acquire user text information associated with the initial CAD graphic, wherein the user text information includes graphic name information, graphic data information and the segmented data of the initial CAD graphic;

[0081] The segmented data is read from the user text information.

[0082] Optionally, in this embodiment, the segmented data associated with the initial CAD graphic can be but is not limited to being determined based on user text information associated with the initial CAD graphic, wherein the user can, but is not limited to, input the user text information associated with the initial CAD graphic when creating the initial CAD graphic, and can, but is not limited to, include the graphic name information, graphic data information and segmented data of the initial CAD graphic.

[0083] To further illustrate, Figure 3 As shown, Figure 3 What is displayed in the figure is user text information associated with a certain CAD graphic, wherein the user text information includes "L2(4)250x600", "L2" in the user text information is used to indicate the graphic name of the CAD graphic, "4" is used to indicate the first segment number associated with the CAD graphic, and "250x600" is used to indicate the graphic data information associated with the CAD graphic.

[0084] As an optional solution, the above CAD graphics segmentation method is applied to a scenario where the program graphics recognition results are corrected according to user text information. According to different node drawing methods of the drawings, several node style templates are established as comparison standards, such as Figure 4 and Figure 5 As shown. Further determine the matching between the proposed corrected position node drawing method and the standard node style and determine the priority of the standard node style participating in the comparison.

[0085] For example, Figure 4 and Figure 5 As shown, an optional merging priority may be but not limited to a1, a2, b1, b2; an optional splitting priority may be but not limited to b3, b2, a1, a2.

[0086] Optionally, in this embodiment, the program completes the segmentation of the building structure graphic recognition according to the general recognition logic, and then intelligently corrects the initial segmentation result by comparing the standard node style based on the text information (segmentation information) marked by the user. If the number of segments is consistent after several corrections, the correction is completed. If the number of segments is still inconsistent, the correction is abandoned.

[0087] Specifically, an optional operation process includes:

[0088] The program reads DWG architectural structure drawings;

[0089] The program segments a beam according to a general algorithm;

[0090] Determine if the number of program segments is inconsistent with the number of user annotations, and execute the correction logic (split or merge). Take the example of program segment number < user annotation number, and split the program segmentation result. Take out the standard node style in order of split priority, and compare it with the nodes of the current beam from left to right. When the style matches, split; if b3, b2, and a3 do not match the node with the same style, skip it. Figure 6 As shown, type a2 can match nodes with the same style and split (assuming the splitting priority is b3, b2, a3, a2). It can be understood that after recognizing the DWG building structure graphics, the program reads the DWG building structure graphics; recognizes and parses the graphics according to the general algorithm to obtain segmentation information; traverses each beam to determine whether the program segmentation result is consistent with the number of segments marked by the user.

[0091] If they are consistent, no correction is required; use relevant modification tools to manually adjust the program recognition results; if they are inconsistent, enter the correction process.

[0092] In the correction process, if the number of initial program segments is greater than the number of user text annotations, the beam segments need to be merged at the nodes. The node templates in the standard node style queue are taken out in order of merging priority, and compared with the drawing methods of the current beam nodes. If the styles are consistent, the beam segments are merged at this node; after a node style is compared and modified, the number of segments of the current beam is compared to the number of user annotations. If they are consistent, the correction is ended. If they are inconsistent, the next node style is taken out for comparison and merge correction; after all node styles in the standard node style queue are compared, if the number of segments is still inconsistent, the correction is abandoned.

[0093] In the correction process, if the number of initial program segments is less than the number of user text annotations, the beam segment needs to be split at the node. The process is the same as above. The nodes in the standard node style queue are taken in turn according to the splitting priority order for comparison and splitting.

[0094] Through the embodiments provided by this application, the accuracy of program recognition is improved; the diversity of professional understanding of different users is taken into consideration, and the applicability of the program is improved. The general program recognition results are automatically optimized to make the program recognition results as consistent as possible with the user's understanding, solving the contradiction between the fixed program algorithm results and the diverse user needs in the segmentation problem of architectural structure drawing recognition.

[0095] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0096] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0097] According to another aspect of the embodiment of the present application, a CAD graphic segmentation device for implementing the above-mentioned CAD graphic segmentation method is also provided. Figure 7 As shown, the device comprises:

[0098] A reading unit 702 is used to read segmentation data associated with the initial CAD graphic from the initial CAD graphic to be segmented, wherein the segmentation data is used to indicate the number of first segments associated with the initial CAD graphic;

[0099] A first segmentation unit 704 is used to perform initial segmentation on the initial CAD graphic to obtain a second number of segmented first CAD graphics;

[0100] The second segmentation unit 706 is used to correct and segment the first CAD figure to obtain a second CAD figure with the first number of segments when the second number of segments is inconsistent with the first number of segments.

[0101] As an optional solution, the second segmentation unit 706 includes:

[0102] A first determination module is used to determine at least one first node style template matching a first graphic area of ​​a first CAD graphic from a node style template set when the second segment number is less than the first segment number, wherein the first graphic area corresponds to a segmentation result of the first CAD graphic;

[0103] A splitting module, used to split the first graphic area using at least one first node style template to obtain a first number of segmented second CAD graphics;

[0104] A second determination module is used to determine at least one second node style template matching a second graphic area of ​​the first CAD graphic from the node style template set when the number of the second segments is greater than the number of the first segments, wherein the second graphic area corresponds to at least two segmentation results of the first CAD graphic;

[0105] The merging module is used to use at least one second node style template to merge the second graphic area to obtain a first number of segmented second CAD graphics.

[0106] As an optional solution, the first determining module is used to include:

[0107] A first acquisition submodule is used to acquire a first node style template with the highest splitting priority from the node style templates;

[0108] The first determination submodule uses the first node style template with the highest priority to compare with each segmentation result from left to right of the first CAD graphic to match and determine the first graphic area with the same style;

[0109] Split modules, including:

[0110] A second determination submodule, configured to determine a second node position corresponding to the first graphic area based on the first node position of the first node style template with the highest priority;

[0111] The splitting submodule is used to split the first graphic area at the second node position to obtain a third CAD graphic with a third number of segments.

[0112] As an optional solution, the device also includes:

[0113] A second acquisition submodule is used for splitting the first graphic area at the second node position to obtain a third CAD graphic with a third number of segments, and when the number of the third segments is less than the number of the first segments, continuing to obtain an unused first node style template with the highest splitting priority from the node style template, and splitting the third CAD graphic until a second CAD graphic with the first number of segments is obtained;

[0114] The third determining submodule is configured to determine the third CAD graphic as the second CAD graphic when the number of the third segments is equal to the number of the first segments.

[0115] As an optional solution, the second determining module includes:

[0116] A third acquisition submodule is used to acquire a second node style template with the highest merging priority from the node style templates;

[0117] The fourth determination submodule is used to use the second node style template with the highest priority to compare with at least two segmentation results from left to right of the second CAD graphic to match and determine a second graphic area with a consistent style;

[0118] Merge modules, including:

[0119] a fifth determination submodule, configured to determine a fourth node position corresponding to the second graphic area based on the third node position of the second node style template with the highest priority;

[0120] The merging submodule is used to merge the second graphic area at a fourth node position to obtain a fourth CAD graphic with a fourth number of segments.

[0121] As an optional solution, the device also includes:

[0122] a fourth acquisition submodule, configured to merge the second graphic area at a fourth node position to obtain a fourth CAD graphic of a fourth number of segments, and then, when the number of the fourth segments is greater than the number of the first segments, continue to obtain an unused second node style template with the highest merging priority from the node style template, and merge the fourth CAD graphic until the second CAD graphic of the first number of segments is obtained;

[0123] The sixth determining submodule is used to determine the fourth CAD figure as the second CAD figure when the fourth segment quantity is equal to the first segment quantity.

[0124] As an optional solution, the reading unit 702 includes:

[0125] An acquisition module is used to acquire user text information associated with the initial CAD graphic, wherein the user text information includes graphic name information, graphic data information and segment data of the initial CAD graphic;

[0126] The reading module is used to read segmented data from user text information.

[0127] For a specific embodiment, reference may be made to the example shown in the above-mentioned CAD graphics segmentation method, which will not be described in detail in this example.

[0128] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned CAD graphics segmentation method is also provided. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.

[0129] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0130] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0131] S1, reading segmentation data associated with the initial CAD graphic from the initial CAD graphic to be segmented, wherein the segmentation data is used to indicate the first segment quantity associated with the initial CAD graphic;

[0132] S2, performing initial segmentation on the initial CAD figure to obtain a first CAD figure of a second number of segments;

[0133] S3, when the second number of segments is inconsistent with the first number of segments, correct the first CAD figure by segmentation to obtain a second CAD figure with the first number of segments.

[0134] Alternatively, a person skilled in the art may understand that: Figure 8 The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), or a PAD. Figure 8 The structure of the electronic device is not limited. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.

[0135] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the segmentation method and device of the CAD graphics in the embodiment of the present application. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, realizing the above-mentioned segmentation method of CAD graphics. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include a memory remotely arranged relative to the processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. Among them, the memory 802 can be specifically but not limited to being used to store information such as the first number of segments and the second number of segments. As an example, such as Figure 8 As shown, the memory 802 may include, but is not limited to, the reading unit 702, the first segmentation unit 704, and the second segmentation unit 706 in the segmentation device of the CAD client. In addition, it may also include, but is not limited to, other module units in the data transmission device of the CAD client, which will not be repeated in this example.

[0136] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include wired networks and wireless networks. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0137] In addition, the electronic device further includes: a display 808 for displaying information such as the number of the first segments and the number of the second segments; and a connection bus 810 for connecting various module components in the electronic device.

[0138] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0139] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0140] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0141] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0142] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory and the random access memory are connected to each other through a bus. The input / output interface (I / O interface) is also connected to the bus.

[0143] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a local area network card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0144] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.

[0145] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.

[0146] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0147] S1, reading segmentation data associated with the initial CAD graphic from the initial CAD graphic to be segmented, wherein the segmentation data is used to indicate the first segment quantity associated with the initial CAD graphic;

[0148] S2, performing initial segmentation on the initial CAD figure to obtain a first CAD figure of a second number of segments;

[0149] S3, when the second number of segments is inconsistent with the first number of segments, correct the first CAD figure by segmentation to obtain a second CAD figure with the first number of segments.

[0150] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0151] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0152] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0153] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0154] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0157] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A segmentation method for CAD graphics, characterized in that: include: Reading segmentation data associated with the initial CAD graphic to be segmented from the initial CAD graphic, wherein the segmentation data is used to indicate the number of first segments associated with the initial CAD graphic; Performing initial segmentation on the initial CAD figure to obtain a second number of segmented first CAD figures; When the second number of segments is inconsistent with the first number of segments, the first CAD drawing is corrected and segmented to obtain a second CAD drawing with the first number of segments, including: In the case where the second number of segments is less than the first number of segments, a first node style template with the highest splitting priority is obtained from the node style template; the first node style template with the highest priority is used to compare with each segmentation result from left to right of the first CAD graphic to match and determine a first graphic area with consistent style, wherein the first graphic area corresponds to a segmentation result of the first CAD graphic; based on the first node position of the first node style template with the highest priority, a second node position corresponding to the first graphic area is determined; the first graphic area is split at the second node position to obtain a third CAD graphic with a third number of segments; When the second number of segments is greater than the first number of segments, a second node style template with the highest merging priority is obtained from the node style templates; the second node style template with the highest priority is used to compare with at least two segmentation results from left to right of the second CAD graphic to match and determine a second graphic area with consistent style, wherein the second graphic area corresponds to at least two segmentation results of the first CAD graphic; based on the third node position of the second node style template with the highest priority, a fourth node position corresponding to the second graphic area is determined; and the second graphic area is merged at the fourth node position to obtain a fourth CAD graphic with a fourth number of segments.

2. The method according to claim 1, characterized in that After splitting the first graphic area at the second node position to obtain a third CAD graphic with a third number of segments, the method further includes: When the number of the third segments is less than the number of the first segments, continue to obtain the unused first node style template with the highest splitting priority from the node style template, and split the third CAD figure until the second CAD figure with the first number of segments is obtained; In a case where the third number of segments is equal to the first number of segments, the third CAD figure is determined as the second CAD figure.

3. The method according to claim 1, characterized in that After merging the second graphic regions at the fourth node position to obtain fourth CAD graphics of a fourth number of segments, the method further includes: When the number of the fourth segments is greater than the number of the first segments, continue to obtain unused second node style templates with the highest merging priority from the node style templates, and perform merging processing on the fourth CAD graphics until the second CAD graphics with the first number of segments are obtained; When the fourth segment number is equal to the first segment number, the fourth CAD figure is determined as the second CAD figure.

4. The method according to any one of claims 1 to 3, characterized in that: The step of reading the segmentation data associated with the initial CAD graphic to be segmented comprises: Acquire user text information associated with the initial CAD graphic, wherein the user text information includes graphic name information, graphic data information and the segmented data of the initial CAD graphic; The segmented data is read from the user text information.

5. A segmentation device for CAD graphics, characterized in that: include: A reading unit, used for reading segmentation data associated with the initial CAD graphic from the initial CAD graphic to be segmented, wherein the segmentation data is used for indicating the number of first segments associated with the initial CAD graphic; A first segmentation unit is used to perform initial segmentation on the initial CAD graphic to obtain a second number of segmented first CAD graphics; The second segmentation unit is used to correct and segment the first CAD figure when the number of the second segments is inconsistent with the number of the first segments to obtain the second CAD figure with the first number of segments, including: In the case where the second number of segments is less than the first number of segments, a first node style template with the highest splitting priority is obtained from the node style template; the first node style template with the highest priority is used to compare with each segmentation result from left to right of the first CAD graphic to match and determine a first graphic area with consistent style, wherein the first graphic area corresponds to a segmentation result of the first CAD graphic; based on the first node position of the first node style template with the highest priority, a second node position corresponding to the first graphic area is determined; the first graphic area is split at the second node position to obtain a third CAD graphic with a third number of segments; When the second number of segments is greater than the first number of segments, a second node style template with the highest merging priority is obtained from the node style templates; the second node style template with the highest priority is used to compare with at least two segmentation results from left to right of the second CAD graphic to match and determine a second graphic area with consistent style, wherein the second graphic area corresponds to at least two segmentation results of the first CAD graphic; based on the third node position of the second node style template with the highest priority, a fourth node position corresponding to the second graphic area is determined; and the second graphic area is merged at the fourth node position to obtain a fourth CAD graphic with a fourth number of segments.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 4 when executed.

7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Visual power distribution network fault section division method

    CN108521124A

  • Optimized segmenting method

    CN110997286A