Method and equipment for automatically generating machining scheme
Image recognition technology extracts the image features of the products to be processed by CNC vehicle machine tools, and automatically matches and generates processing solutions, solving the problem of programming in the existing technology that improves processing efficiency and quality.
Patent Information
- Application Number
- CN202510293628.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-13
AI Technical Summary
In the prior art, the programming of CNC vehicle machine tools relies on manual operation, resulting in quality and efficiency relying on the technical level and experience of technicians, and the preparation of technical documents is difficult and inefficient.
By obtaining the image data of the product to be processed, image features are extracted using image recognition technology, the processing allowance area is determined, and the corresponding processing plan is matched in the product database, and the tool and processing plan are automatically selected.
It improves the degree of automation, reduces the difficulty and time of technical documents, reduces the dependence on the technical level of technicians, and ensures the quality and efficiency of processing plans.
Smart Images

Figure CN119808436A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to a method and device for automatically generating a processing plan. Background Art
[0002] With the advancement of technology, the use of CNC lathes has become popular, but the use of programming methods is basically in the manual operation stage.
[0003] In the traditional solution, when compiling G code (a programming language for computer numerical control machine tools, also known as G programming language, G-code), although relevant software can be used, most operations still require manual operation by technicians. The final quality and efficiency depend on the technicians' technical level, experience, and standardized execution, and are not strictly controlled.
[0004] As the types of products and order volumes increase, the issuance of technical documents has become a bottleneck affecting production. The training of technical personnel takes a long time, the results are slow, and the quality and efficiency are unstable, resulting in low code compilation efficiency. Summary of the invention
[0005] In order to solve the above problems, this application proposes a method for automatically generating a processing plan, including: Acquire image data of the product to be processed, and acquire image features corresponding to the image data through image recognition; Determine the machining allowance area of the product to be processed according to the image features, and perform matching in a product database according to the machining allowance area; For the first sub-region that is successfully matched, obtaining a first matching processing solution in the product database; For the second sub-region where the matching fails, a matching tool and response parameters are selected according to the image features corresponding to the second sub-region, and a second processing plan is generated; A product processing plan corresponding to the product to be processed is generated by combining the first processing plan and the second processing plan.
[0006] In one example, obtaining image data of a product to be processed and obtaining image features corresponding to the image data through image recognition specifically includes: Acquire image data of the product to be processed; the image data includes processing image data and blank image data; Perform image recognition on the processing image data and the blank image data to obtain corresponding processing contour data and blank contour data; Vertex detection is performed on the processing contour data and the blank contour data respectively, and segmentation processing is performed according to the detected vertices to extract corresponding image features.
[0007] In one example, vertex detection is performed on the processing contour data and the blank contour data, and segmentation processing is performed according to the detected vertices to extract corresponding image features, specifically including: For each contour data, vertex detection is performed to obtain corresponding vertices; wherein the contour data includes the processing contour data and the blank contour data; Based on a polygonal approximation algorithm, the vertices are screened to delete redundant vertices and retain key vertices; The contour data is segmented according to key nodes to obtain corresponding line segments.
[0008] In one example, determining the machining allowance area of the product to be processed according to the image features, and matching in a product database according to the machining allowance area specifically includes: Obtaining a machining allowance area according to a difference between the machining contour data and the blank contour data; Dividing the machining allowance area into a plurality of sub-areas; For the sub-region, corresponding sub-features are generated according to the image features, and matching is performed in a product database according to the sub-features.
[0009] In one example, the machining allowance area is divided into a plurality of sub-areas, specifically including: Determine a first vertex and a first line segment corresponding to the machining contour data, and a second vertex and a second line segment corresponding to the blank contour data; For the first vertex, if the distance between the first vertex and the second vertex closest to it is less than a preset distance, a mapping relationship is established between the first vertex and the second vertex; If the distance between the first vertex and the second vertex closest to it is greater than a preset distance, projecting the first vertex onto the second line segment closest to it, and establishing a mapping relationship between the first vertex and the projection point; Connect the vertices with established mapping relationships to obtain a third line segment; For each first line segment, the second line segment and the third line segment are combined to obtain a corresponding sub-region.
[0010] In one example, for the first vertex, if the distance between the first vertex and the second vertex closest to the first vertex is less than a preset distance, a mapping relationship is established between the first vertex and the second vertex, specifically including: Determining, based on the angle between the first line segments, that the machining contour data has a concave portion; Among the first vertices, determine the designated vertices corresponding to the concave portion, and determine the outermost first designated vertex and the inner second designated vertex among the designated vertices; For the first designated vertex, if the distance between the first designated vertex and the second vertex closest to it is less than a preset distance, a mapping relationship is established between the first designated vertex and the second vertex; No mapping relationship is established for the second designated vertex; For each first line segment, the second line segment and the third line segment are combined to obtain a corresponding sub-region, which specifically includes: For the concave portion, all the first line segments contained therein are combined as a single first line segment, which is used to combine with the second line segment and the third line segment to obtain a corresponding sub-region.
[0011] In one example, the method further includes: Determine the area of each sub-region; If the area of the region is smaller than the preset area, the sub-region is merged with other adjacent sub-regions into a single sub-region; When the sub-regions are merged, other sub-regions with longer common edges are selected for fusion, and if the merged single sub-region is a concave polygon, the fusion is abandoned.
[0012] In one example, before matching in a product database according to the sub-feature, the method further includes: Get each historical sub-area corresponding to the historical processed products; For the historical sub-region, determine the corresponding shape data, as well as the vertices and line segments contained therein, and perform normalization processing; Extracting corresponding image features from shape data, vertices, and line segments of the historical sub-region, and performing quantization processing on the image features; The quantized features obtained after the quantization process are encoded to obtain feature codes, and corresponding indexes are established based on the feature codes and stored in a product database.
[0013] In one example, encoding the quantized features obtained after the quantization process to obtain feature codes, and establishing corresponding indexes based on the feature codes specifically includes: Determine the quantitative features obtained after the quantization process; For the first quantitative features corresponding to the vertices and the line segments, concatenate them in vertex order to obtain a local feature code; Adding the second quantized feature corresponding to the shape data to the header of the local feature code to obtain a global feature code; The global feature code is associated with the processing plan corresponding to the historical sub-area, and an index is established according to the global feature code and stored in a product database.
[0014] On the other hand, the present application also proposes a processing scheme automatic generation device, comprising: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automatic generation method of the processing plan as described in any of the above examples.
[0015] The automatic generation method of processing scheme proposed in this application can bring the following beneficial effects: 1. High degree of automation, including key steps such as feature recognition, tool selection, and processing plan, greatly reduces the difficulty of technical document preparation and improves the preparation speed.
[0016] 2. By adding the comparison function between the blank contour and the processed contour, most of the steps that require manual operation are replaced by software judgment, making the solution process smooth.
[0017] 3. It is not highly dependent on the technical level of technical personnel, and the accumulated experience of technical personnel can be digitized and directly reused.
[0018] 4. Since the blank, machining contour, and automatic tool selection are used at the same time, basic simulation verification can be performed to ensure that the tool path produced will not cause collision in actual use, thereby ensuring the quality of the code. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of a process flow of a method for automatically generating a processing plan in an embodiment of the present application; Figure 2 This is a flow chart of a method for automatically generating a processing plan in one situation in an embodiment of the present application; Figure 3 A schematic diagram of image features of image data in one scenario in an embodiment of the present application; Figure 4 This is a schematic diagram of the equipment for automatically generating processing plans in the embodiments of the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. 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 making creative work are within the scope of protection of the present application.
[0021] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0022] like Figure 1 and Figure 2 As shown, the embodiment of the present application provides a method for automatically generating a processing plan, including: S101: Acquire image data of a product to be processed, and acquire image features corresponding to the image data through image recognition.
[0023] Specifically, image data of the product to be processed is obtained; the image data includes processed image data and blank image data. The blank image data refers to the image of the workpiece before processing, and the processed image data refers to the image of the workpiece after processing. Figure 3 As shown, corresponding processing image data can be added based on the outer blank image data and based on the same center point.
[0024] Image recognition is performed on the processing image data and the blank image data to obtain the corresponding processing contour data and blank contour data. Figure 3 As shown, generally speaking, the outer contour is the blank contour data, and the inner contour is the processing contour data. Here, the inner processing contour data is called A contour, and the outer blank contour data is called B contour.
[0025] Vertex detection is performed on the processing contour data and the blank contour data, and segmentation processing is performed based on the detected vertices to extract the corresponding image features. The image features may include features corresponding to the image such as vertices, line segments, and the entire contour (for example, position, length, area, etc.).
[0026] Furthermore, after vertex detection is performed on each contour data (including processing contour data and blank contour data) and corresponding vertices are obtained, the vertices can be screened based on a polygon approximation algorithm (for example, the Douglas-Peucker algorithm) to delete redundant vertices and retain key vertices to simplify the contour (when simplifying the contour, only the number of vertices is simplified, and the line segments are not simplified, but the length and shape of the original line segments are retained).
[0027] At this time, the contour data is segmented according to the key nodes to obtain the corresponding line segments. Figure 3 As shown, the A contour can be split into line segments A1~A10, and the B contour can be split into line segments B1~B4.
[0028] S102: Determine a machining allowance region of the product to be machined according to the image features, and perform matching in a product database according to the machining allowance region.
[0029] The machining allowance area refers to the area that needs to be cut off when machining the blank contour. After cutting off the machining allowance area, the remaining area is the area corresponding to the machining contour. At this time, the machining allowance area can be obtained based on the difference between the machining contour data and the blank contour data.
[0030] In the embodiment of the present application, Figure 3 For example, the Z axis is the rotary axis, and the cross-sectional view of the product is observed at this time. The descriptions of the machining allowance area, sub-area, vertex, line segment, etc. in the embodiments of the present application, unless otherwise specified, can be considered as the corresponding area, vertex, line segment on the cross-sectional view.
[0031] In some cases, there may be overlap between the machining contour data and the blank contour data. In this case, the overlapping line segments may be no longer considered, and the corresponding machining allowance areas may be generated separately.
[0032] The product database contains image features of products that have been processed in the past or generated and verified by technicians, as well as the corresponding processing plans for the products. The processing plans include the selected tools, tool paths, etc.
[0033] In the actual comparison process, the image features of the area, line segments, and vertices corresponding to the machining allowance area can be directly compared to obtain similar processed products. The product to be processed can match a completely similar product in the product database, and the existing processing plan can be reused. If there is only a partial match, only the matching part can be reused.
[0034] However, in this comparison method, the profile data of the compared products is relatively large, and it is difficult to find other products that are very similar between products of different models and batches.
[0035] Based on this, the machining allowance area can be divided into multiple sub-areas. Since the shapes of the sub-areas are small and usually regular, by comparing the sub-areas, the parts similar to the sub-areas can be selected more quickly, and the products to be processed can be divided into blocks, increasing the probability of similar hits in the sub-areas.
[0036] Specifically, the machining allowance area is divided into multiple sub-areas, and corresponding sub-features are generated for the sub-areas according to the image features, and the sub-features are matched in the product database according to the sub-features. Among them, based on the image features that have been obtained, the corresponding sub-features can be extracted from the image features according to the vertices and line segments contained in the sub-area.
[0037] Furthermore, when dividing the sub-areas, considering that the order of processing in the actual processing process is usually to feed the tool according to the line segments of the processing contour data, when actually dividing the sub-areas, the line segments corresponding to the processing contour data can be used as the basis for division. A line segment corresponding to the processing contour data corresponds to a sub-area, and a sub-area corresponds to a processing plan. In this way, when actually designing the tool path, each action of the tool can complete the processing of a line segment corresponding to the processing contour data, which is more in line with the actual working situation.
[0038] Based on this, the first vertex and the first line segment corresponding to the machining contour data, and the second vertex and the second line segment corresponding to the blank contour data are determined.
[0039] For a first vertex, if the distance between the first vertex and the second vertex closest to it is lower than a preset distance, a mapping relationship is established between the first vertex and the second vertex. If the distance between the first vertex and the second vertex closest to it is higher than a preset distance, the first vertex is projected on the second line segment closest to it, and a mapping relationship is established between the first vertex and the projection point.
[0040] The vertices with established mapping relationships are connected to obtain a third line segment.
[0041] The purpose of establishing the mapping relationship is to find other vertices that are closer to each first vertex. If there is a second vertex that is closer, then the vertex is directly selected. If there is no second vertex that is closer, then the nearest projection point is selected through projection. The two are then connected as the second line segment.
[0042] In actual work, the second line segment is located in the machining allowance area. Its purpose is to cut the machining allowance area to obtain multiple sub-areas. Therefore, the length of the second line segment finally generated cannot be too long, resulting in too long feed distance and affecting the machining quality.
[0043] At this time, for each first line segment, the second line segment and the third line segment are combined to obtain a corresponding sub-region.
[0044] The shape of the combined sub-area is different according to different actual situations. For the first line segment, if the mapping relationship between the first vertices at both ends is the same second vertex, then the sub-area is a triangle, which does not contain the second line segment. If at least one of the mapping relationships between the first vertices at both ends is a mapping point, then the sub-area is a quadrilateral, which may be a rectangle, trapezoid, etc., and it contains a complete or partial second line segment.
[0045] Of course, in the second line segment of the mapping relationship, the situation of passing through the processing contour data usually does not occur. If it occurs, other second vertices or mapping points are replaced in order from small to large distances until the requirement is met.
[0046] However, some special situations may occur in the actual processing process.
[0047] For the first case, some special sub-areas that are difficult to divide directly (for example, separately set opening areas) can be marked manually.
[0048] For the second case, according to the angle between the first line segments, it is determined that there is a concave portion in the processing contour data. At this time, generating sub-areas by the previous method will cause chaotic overlap between the sub-areas.
[0049] Based on this, the designated vertex corresponding to the concave portion is determined in the first vertex, and the outermost first designated vertex and the inner second designated vertex are determined in the designated vertices. The first designated vertex and the second designated vertex can be determined based on the distance between each vertex and the blank contour data and the angle (which is an acute angle) of the first line segment at the vertex.
[0050] For the first designated vertex, if the distance between the first designated vertex and the second vertex closest to it is less than the preset distance, a mapping relationship is established between the first designated vertex and the second vertex. That is, for the outermost first designated vertex, a mapping relationship is still established in the previous manner.
[0051] For the second designated vertex, if the mapping relationship continues to be established, it will cause confusion in the establishment of the sub-regions, so the mapping relationship is no longer established.
[0052] At this time, for the concave part, all the first line segments contained therein are combined as a single first line segment, which is used to combine according to the second line segment and the third line segment to obtain the corresponding sub-area. In other words, the sub-area generated at this time may be a polygon, a part of which is a single first line segment obtained by combining the first line segments, and then also includes a third line segment formed by the mapping relationship corresponding to the two first specified vertices. If the two mapping relationships do not point to the same point, it may also include part or one or more second line segments.
[0053] For the third case, if the area of the sub-region is too small, it will also cause the tool to feed too many times, thus wasting work efficiency.
[0054] Based on this, the area of each sub-region is determined. If the area of the region is lower than the preset area, the sub-region is merged with other adjacent sub-regions into a single sub-region.
[0055] Among them, the area below the preset area is divided into two sub-cases. The first sub-case is as follows: Figure 3 As shown, since the A5 and A7 line segments are far away from the second vertex, the projection method is selected. However, since they are perpendicular to the nearest second line segment, the projection points at both ends overlap, resulting in the area of the sub-region being 0. At this time, the sub-region can be directly discarded.
[0056] As for other sub-regions with smaller areas, they can be merged. When merging the sub-regions, other sub-regions with longer common edges are selected for merging, thereby reducing the working feed length of the tool path. If the single sub-region after fusion is a concave polygon, the fusion is abandoned to reduce the working difficulty of the tool.
[0057] S103: For the first sub-region that is matched successfully, obtaining a first matching processing solution from the product database.
[0058] If the product can be matched with a completely similar product in the database, the existing processing plan will be reused. The first processing plan may include: the feed path of the tool, cutting speed, feed amount, cutting depth, etc.
[0059] Here, the existing first processing plan can be directly applied to the actual processing of the first sub-area.
[0060] S104: For the second sub-region that fails to match, select a matching tool and response parameters according to image features corresponding to the second sub-region, and generate a second processing plan.
[0061] like Figure 3 As shown in the figure, the Z axis is the rotary axis, where the three line segments A5, A6, and A7 form the outer annular groove. Assuming that the corresponding sub-region is the second sub-region where the matching fails, the corresponding groove cutter is selected according to the distance between the A5 and A7 line segments. As for the A1 line segment, it is the inner hole, and the corresponding inner hole turning tool can be selected according to the size of the inner hole. At the same time, the appropriate parameters are automatically selected according to the corresponding dimensional tolerance annotation, roughness, etc.
[0062] For different image features, you can set and sort out the corresponding program templates in advance, and use variable strings for size-related ones, such as: N42 G01 {startZ} {f} N43 G01 {diameter} N44 G01 {endZ} The result after reading is startZ = -781, diameter = 3372, endZ = -779.5, f = 0.55 Substitute the result into the generated code. The following is the generated code snippet: N32; Rough turning of end face outer circle N33; 80 degree diamond right-handed blade N34 ;R1.6 N39 M3 N40 M08 N41 G04 F5 N42 G01 Z-781 F0.55 N43 G01 X1686 N44 G01 Z-779.5 N45 G00 X2000 Z-200 N46 M05 M09 N47M00 N48 LSE N49 LSS N50; Verify end face allowance N51 G00 Z-200 N52 G00 X1784 Z-778 N53 G96 S105 LIMS=63 N54 M3 N55 M08 In this way, the corresponding second processing plan can be generated.
[0063] S105: Generate a product processing plan corresponding to the product to be processed based on the first processing plan and the second processing plan.
[0064] When combining, for adjacent sub-areas, if the types of the tools selected therefor are consistent, the processing plans of the two sub-areas can be combined into a second processing plan, thereby improving work efficiency.
[0065] Of course, corresponding functions can also be added, such as adding a probe measurement reference program, automatically measuring the reference surface, hole position or feature of the workpiece through the probe to reduce human errors, and automatically adding trial cutting codes for precision work based on tolerance judgment, thereby adding trial cutting steps before formal processing to verify whether the cutting parameters are reasonable; after the trial cutting is completed, the probe is used to measure the size, and automatic compensation is made based on the measurement results. By measuring the actual size after the trial cutting and comparing it with the theoretical value, the tool compensation is automatically corrected; for the addition of compensation values with special precision requirements, the operator is allowed to make changes, and there is maximum compensation to prevent mistakes and prevent out-of-tolerance; tool life calculations are performed, and blade replacement nodes are added based on the tool processing distance.
[0066] For example, the following is the added code snippet for replacing a blade node: N111 LSE N112 LSS N113 ;Replace the blade N114 G00 Z-200 N115 G00 X1042.625 Z-523.73 N116 G96 S115 LIMS=63 N117 M3 N118 M08 After obtaining the final product processing plan, the program files, program sheets and other production guidance documents can be output according to the specifications, and the identified new features can be automatically stored in the database to enrich the product library and feature library. For completely new features, manual programming can be performed, and the operation results can be stored in the database after manual programming.
[0067] In the process of matching products and features, multiple products and technical solutions can be provided and sorted according to the matching degree. Users can select the appropriate solution for reuse, and the selected results will also be stored. In addition, AI technology can be added for analysis to update and promote the matching algorithm.
[0068] 1. High degree of automation, including key steps such as feature recognition, tool selection, and processing plan, greatly reduces the difficulty of technical document preparation and improves the preparation speed.
[0069] 2. By adding the comparison function between the blank contour and the processed contour, most of the steps that require manual operation are replaced by software judgment, making the solution process smooth.
[0070] 3. It is not highly dependent on the technical level of technical personnel, and the accumulated experience of technical personnel can be digitized and directly reused.
[0071] 4. Since the blank, machining contour, and automatic tool selection are used at the same time, basic simulation verification can be performed to ensure that the tool path produced will not cause collision in actual use, thereby ensuring the quality of the code.
[0072] In one embodiment, when adding image features to a product database and performing matching in the product database based on sub-features, it is possible to choose to perform matching directly based on the image features.
[0073] However, this matching method requires more computing power. As the amount of data stored in the product database increases, the system burden will increase and the matching speed will decrease.
[0074] Based on this, when constructing the product database, the historical sub-regions corresponding to the historical processed products are obtained. Alternatively, some sub-regions that have been manually identified can also be directly added to the product database.
[0075] For the historical sub-region, determine its corresponding shape data, as well as the vertices and line segments contained therein, and perform normalization processing. The shape data, vertices, and line segments can be obtained through the image feature acquisition process mentioned above, and the shape data can be understood as the contour data corresponding to the sub-region. In order to distinguish it from the processing contour data and the blank contour data, it is called shape data.
[0076] Normalization can eliminate the effects of translation, rotation, and scaling, such as translation to the origin, scaling to unit size, and alignment based on the main direction. Of course, it is necessary to mark which line segment is the first line segment. When performing similarity matching, no matter which comparison method is used, the first line segment needs to be aligned before matching.
[0077] For the shape data, vertices, and line segments of the historical sub-region, the corresponding image features are extracted and quantified. Image features can also be understood as geometric features, and their corresponding geometric attributes can include: global features obtained from shape data (for example, perimeter, area, minimum enclosing rectangle aspect ratio), local features obtained from vertices and line segments (for example, relative positions and angles of key vertices, vertex polar coordinates, topological structure, etc.).
[0078] For quantization processing, for length (for example, circumference, radius, etc.), it can be divided into N intervals, each represented by a character. For angles (for example, vertex angles), it can be divided into M directions, each represented by a character.
[0079] In order to distinguish global features from local features, global features can be represented by different character rules.
[0080] The quantitative features obtained after the quantization process are encoded to obtain feature codes, and corresponding indexes are established based on the feature codes and stored in the product database.
[0081] In this way, feature codes are stored in the product database, and feature codes are also used for comparison in actual comparison. The complexity of string comparison is much lower than that of geometric calculation, so the matching speed is faster. There is no need for complex matrix operations, only string operations and hash table queries, less code and less computing resources are required. And through the corresponding hierarchical matching and quantization rules, both global and local features can be taken into account to ensure the accuracy of the matching results.
[0082] Furthermore, when encoding, the quantization feature obtained after the quantization process may be determined first.
[0083] For the first quantized features corresponding to the vertices and line segments, they are concatenated in the order of vertices to obtain local feature codes. For example, the polar coordinates of the vertex are (r=7, θ=3), and the local feature code obtained by quantization is 7C. Then, in the order of vertices (for example, clockwise or counterclockwise), the local feature codes obtained are 5D, 2A, etc. Of course, the local feature codes corresponding to the corresponding line segments can also be added between two vertices. The completed local feature code is: 7C-5D-2A...
[0084] At this time, the second quantized feature corresponding to the shape data is added to the header of the local feature code to obtain the global feature code. For example, if the perimeter = 85 and the area = 30, the corresponding global feature code is 85 + 30. At this time, the final code example is 85-30-7C-5D-2A... The global feature code is associated with the processing plan corresponding to the historical sub-area, and an index is established based on the global feature code and stored in the product database. In this way, when matching, the global feature code is first quickly screened, and then matched based on the local feature code, so as to screen out similar products (for example, the similarity exceeds the preset threshold), and realize the dynamic update process of multi-level matching.
[0085] like Figure 4 As shown, the embodiment of the present application also provides a processing plan automatic generation device, including: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for automatically generating a processing plan as described in any of the above embodiments.
[0086] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: the method for automatically generating a processing plan as described in any of the above embodiments.
[0087] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0088] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0089] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for automatically generating a processing plan, characterized in that: include: Acquire image data of the product to be processed, and acquire image features corresponding to the image data through image recognition; Determine the machining allowance area of the product to be processed according to the image features, and perform matching in a product database according to the machining allowance area; For the first sub-region that is successfully matched, obtaining a first matching processing solution in the product database; For the second sub-region where the matching fails, a matching tool and response parameters are selected according to the image features corresponding to the second sub-region, and a second processing plan is generated; A product processing plan corresponding to the product to be processed is generated by combining the first processing plan and the second processing plan.
2. The method for automatically generating a processing plan according to claim 1, characterized in that: Acquiring image data of the product to be processed, and acquiring image features corresponding to the image data through image recognition, specifically including: Acquire image data of the product to be processed; the image data includes processing image data and blank image data; Perform image recognition on the processing image data and the blank image data to obtain corresponding processing contour data and blank contour data; Vertex detection is performed on the processing contour data and the blank contour data respectively, and segmentation processing is performed according to the detected vertices to extract corresponding image features.
3. The method for automatically generating a processing plan according to claim 2, characterized in that: Vertex detection is performed on the processing contour data and the blank contour data respectively, and segmentation processing is performed according to the detected vertices to extract corresponding image features, specifically including: For each contour data, vertex detection is performed to obtain corresponding vertices; wherein the contour data includes the processing contour data and the blank contour data; Based on a polygonal approximation algorithm, the vertices are screened to delete redundant vertices and retain key vertices; The contour data is segmented according to key nodes to obtain corresponding line segments.
4. The method for automatically generating a processing plan according to claim 2, characterized in that: Determining a machining allowance region of the product to be processed according to the image features, and matching in a product database according to the machining allowance region, specifically comprising: Obtaining a machining allowance area according to a difference between the machining contour data and the blank contour data; Dividing the machining allowance area into a plurality of sub-areas; For the sub-region, corresponding sub-features are generated according to the image features, and matching is performed in a product database according to the sub-features.
5. The method for automatically generating a processing plan according to claim 4, characterized in that: The machining allowance area is divided into a plurality of sub-areas, specifically including: Determine a first vertex and a first line segment corresponding to the machining contour data, and a second vertex and a second line segment corresponding to the blank contour data; For the first vertex, if the distance between the first vertex and the second vertex closest to it is less than a preset distance, a mapping relationship is established between the first vertex and the second vertex; If the distance between the first vertex and the second vertex closest to it is greater than a preset distance, projecting the first vertex onto the second line segment closest to it, and establishing a mapping relationship between the first vertex and the projection point; Connect the vertices with established mapping relationships to obtain a third line segment; For each first line segment, the second line segment and the third line segment are combined to obtain a corresponding sub-region.
6. The method for automatically generating a processing plan according to claim 5, characterized in that: For the first vertex, if the distance between the first vertex and the second vertex closest to the first vertex is less than a preset distance, a mapping relationship is established between the first vertex and the second vertex, specifically including: Determining, based on the angle between the first line segments, that the machining contour data has a concave portion; Among the first vertices, determine the designated vertices corresponding to the concave portion, and determine the outermost first designated vertex and the inner second designated vertex among the designated vertices; For the first designated vertex, if the distance between the first designated vertex and the second vertex closest to it is less than a preset distance, a mapping relationship is established between the first designated vertex and the second vertex; No mapping relationship is established for the second designated vertex; For each first line segment, the second line segment and the third line segment are combined to obtain a corresponding sub-region, which specifically includes: For the concave portion, all the first line segments contained therein are combined as a single first line segment, which is used to combine with the second line segment and the third line segment to obtain a corresponding sub-region.
7. The method for automatically generating a processing plan according to claim 5, characterized in that: The method further comprises: Determine the area of each sub-region; If the area of the region is smaller than the preset area, the sub-region is merged with other adjacent sub-regions into a single sub-region; When the sub-regions are merged, other sub-regions with longer common edges are selected for fusion, and if the merged single sub-region is a concave polygon, the fusion is abandoned.
8. The method for automatically generating a processing plan according to claim 4, characterized in that: Before matching in the product database according to the sub-features, the method further includes: Get each historical sub-area corresponding to the historical processed products; For the historical sub-region, determine the corresponding shape data, as well as the vertices and line segments contained therein, and perform normalization processing; Extracting corresponding image features from shape data, vertices, and line segments of the historical sub-region, and performing quantization processing on the image features; The quantized features obtained after the quantization process are encoded to obtain feature codes, and corresponding indexes are established based on the feature codes and stored in a product database.
9. The method for automatically generating a processing plan according to claim 8, characterized in that: The quantized features obtained after the quantization process are encoded to obtain feature codes, and corresponding indexes are established based on the feature codes, specifically including: Determine the quantitative features obtained after the quantization process; For the first quantitative features corresponding to the vertices and the line segments, concatenate them in vertex order to obtain a local feature code; Adding the second quantized feature corresponding to the shape data to the header of the local feature code to obtain a global feature code; The global feature code is associated with the processing plan corresponding to the historical sub-area, and an index is established according to the global feature code and stored in a product database.
10. A processing plan automatic generation device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automatic generation method of the processing plan as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Rapid numerical control programming method suitable for complex slender surface of part
CN114089692A
Numerical control machine tool workpiece machining allowance determining method based on image recognition
CN114708587A
Casting blank allowance automatic detection and processing method
CN115740582A
Three-dimensional process automatic modeling method
CN115935446A
Cutter parameter adjusting method based on numerical control machine tool and related equipment
CN115993804A