Method and device for automatically generating a processing plan

Image recognition technology extracts the image features of the product to be processed and matches the corresponding processing schemes in the product database, solving the problems of low programming efficiency and unstable quality of CNC vehicle machine tools, and achieving efficient and automated automatic generation of machining solutions.

CN119808436BActive Publication Date: 2025-06-20HIMILE PRECISION MASCH (SHANDONG) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510293628.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-20
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The existing CNC vehicle machine tool programming methods mainly rely on manual operations, resulting in low compilation efficiency, unstable quality, and long training time for technicians and slow results.

Method used

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 to automatically generate the processing plan.

Benefits of technology

It improves the compilation speed and automation level, reduces the difficulty of compiling technical documents, reduces the dependence on the technical level of technicians, and ensures the code quality through simulation verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808436B_ABST
    Figure CN119808436B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for automatically generating a processing plan, which relates to the field of data processing. The method includes: obtaining image data of a product to be processed, and acquiring image features corresponding to the image data through image recognition; determining a machining allowance area of the product to be processed according to the image features, and performing matching in a product database according to the machining allowance area; for a first sub-region with successful matching, obtaining a matching first processing plan in the product database; for a second sub-region with failed matching, selecting a matching tool and response parameters according to the image features corresponding to the second sub-region, and generating a second processing plan; combining the first processing plan and the second processing plan to generate a product processing plan corresponding to the product to be processed. It has a high degree of automation, including several key steps such as feature recognition, tool selection, and processing plan replication, greatly reducing the difficulty of compiling technical documents and improving the compilation speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This 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 progress of technology, the use of numerically controlled lathes has now been popularized, 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 need to be manually operated by technicians. Ultimately, the quality and efficiency depend on the technical level, experience, and standard execution of technicians, and are not strictly controlled.

[0004] With the increase in the variety and order volume of products, the distribution of technical documents has become a bottleneck affecting production. The training time of technicians is long, the effect is slow, and the quality and efficiency are unstable, resulting in low code compilation efficiency. Summary of the Invention

[0005] To solve the above problems, this application proposes a method for automatically generating a processing plan, including:

[0006] Obtain image data of the product to be processed, and obtain image features corresponding to the image data through image recognition;

[0007] According to the image features, determine the machining allowance area of the product to be processed, and perform matching in the product database according to the machining allowance area;

[0008] For the first sub-region with successful matching, obtain the matching first processing plan in the product database;

[0009] For the second sub-region with failed matching, select a matching tool and response parameters according to the image features corresponding to the second sub-region, and generate a second processing plan;

[0010] According to the first processing plan and the second processing plan, combine and generate the product processing plan corresponding to the product to be processed.

[0011] In one example, obtaining image data of the product to be processed and obtaining image features corresponding to the image data through image recognition specifically includes:

[0012] Obtain image data of the product to be processed; the image data includes processing image data and blank image data;

[0013] Perform image recognition on the processed image data and the blank image data respectively to obtain the corresponding processed contour data and blank contour data;

[0014] Perform vertex detection on the processed contour data and the blank contour data respectively, and perform segmentation processing based on the detected vertices to extract the corresponding image features.

[0015] In one example, performing vertex detection on the processed contour data and the blank contour data respectively, and performing segmentation processing based on the detected vertices to extract the corresponding image features specifically includes:

[0016] Perform vertex detection on each contour data to obtain the corresponding vertices; wherein, the contour data includes the processed contour data and the blank contour data;

[0017] Based on the polygon approximation algorithm, screen the vertices to delete redundant vertices and retain key vertices;

[0018] Perform segmentation processing on the contour data according to the key nodes to obtain the corresponding line segments.

[0019] In one example, determine the machining allowance area of the product to be machined according to the image features, and perform matching in the product database according to the machining allowance area, specifically including:

[0020] Obtain the machining allowance area according to the difference between the processed contour data and the blank contour data;

[0021] Divide the machining allowance area into multiple sub-areas;

[0022] For the sub-areas, generate corresponding sub-features according to the image features and perform matching in the product database according to the sub-features.

[0023] In one example, dividing the machining allowance area into multiple sub-areas specifically includes:

[0024] Determine the first vertex and the first line segment corresponding to the processed contour data, and the second vertex and the second line segment corresponding to the blank contour data;

[0025] For the first vertex, if the distance between the first vertex and the second vertex closest to it is lower than the preset distance, establish a mapping relationship between the first vertex and the second vertex;

[0026] If the distance between the first vertex and the second vertex closest to it is higher than the preset distance, project the first vertex onto the second line segment closest to it and establish a mapping relationship between the first vertex and the projection point;

[0027] Connect the vertices with the established mapping relationships to obtain a third line segment;

[0028] For each first line segment, combine it according to the second line segment and the third line segment to obtain the corresponding sub-region.

[0029] In one example, for the first vertex, if the distance between the first vertex and the second vertex closest to it is lower than a preset distance, establish a mapping relationship between the first vertex and the second vertex, specifically including:

[0030] Determine that there is a concave part in the machining profile data according to the included angle between the first line segments;

[0031] Among the first vertices, determine the specified vertices corresponding to the concave part, and determine the outermost first specified vertex and the inner second specified vertex among the specified vertices;

[0032] For the first specified vertex, if the distance between the first specified vertex and the second vertex closest to it is lower than a preset distance, establish a mapping relationship between the first specified vertex and the second vertex;

[0033] For the second specified vertex, no mapping relationship is established;

[0034] For each first line segment, combine it according to the second line segment and the third line segment to obtain the corresponding sub-region, specifically including:

[0035] For the concave part, combine all the first line segments included therein as a single first line segment for combination according to the second line segment and the third line segment to obtain the corresponding sub-region.

[0036] In one example, the method further includes:

[0037] Determine the area of each sub-region;

[0038] If the area of the sub-region is lower than a preset area, fuse the sub-region with other adjacent sub-regions into a single sub-region;

[0039] Among them, when fusing the sub-region, select other sub-regions with longer common sides for fusion, and if the fused single sub-region is a concave polygon, abandon this fusion.

[0040] In one example, before matching according to the sub-features in the product database, the method further includes:

[0041] Obtain each historical sub-region corresponding to the historical processed products;

[0042] For the historical sub-region, determine its corresponding shape data, as well as the vertices and line segments it contains, and perform normalization processing;

[0043] For the shape data, vertices, and line segments of the historical sub-region, extract the corresponding image features respectively, and perform quantization processing on the image features;

[0044] Encode the quantization features obtained after quantization processing to obtain feature encodings, and establish corresponding indexes based on the feature encodings and store them in the product database.

[0045] In one example, encoding the quantization features obtained after quantization processing to obtain feature encodings, and establishing corresponding indexes based on the feature encodings specifically includes:

[0046] Determine the quantization features obtained after quantization processing;

[0047] For the first quantization features corresponding to the vertices and the line segments, splice them in vertex order to obtain local feature encodings;

[0048] Add the second quantization feature corresponding to the shape data to the head of the local feature encoding to obtain a global feature encoding;

[0049] Associate the global feature encoding with the processing scheme corresponding to the historical sub-region, and establish an index according to the global feature encoding and store it in the product database.

[0050] On the other hand, the present application also proposes a processing scheme automatic generation device, including:

[0051] At least one processor; and,

[0052] A memory communicatively connected to the at least one processor; wherein,

[0053] The memory stores instructions executable 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 processing scheme automatic generation method as described in any of the above examples.

[0054] The processing scheme automatic generation method proposed by the present application can bring the following beneficial effects:

[0055] 1. The degree of automation is high, including several key steps such as feature recognition, tool selection, and processing scheme replication, which greatly reduces the difficulty of technical document compilation and improves the compilation speed.

[0056] 2. By adding a comparison function between the blank contour and the machining contour, most of the steps that require manual operation are replaced by software judgment, making the scheme process smooth.

[0057] 3. It has low dependence on the technical level of technicians, digitalizes the experience accumulation in technician training, and directly reuses it.

[0058] 4. Since the blank, machining profile, and tool are automatically selected simultaneously, basic simulation verification can be carried out, which can ensure that the tool path generated will not cause collisions during actual use and guarantee the code quality. Description of the Drawings

[0059] The drawings described herein are used to provide a further understanding of the present application, form a part of the present application, and the schematic embodiments and descriptions thereof are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:

[0060] Figure 1 is a schematic flow chart of the method for automatically generating a machining plan in an embodiment of the present application;

[0061] Figure 2 is a schematic flow chart of the method for automatically generating a machining plan in a certain situation in an embodiment of the present application;

[0062] Figure 3 is a schematic diagram of the image features of image data in a certain situation in an embodiment of the present application;

[0063] Figure 4 is a schematic diagram of the device for automatically generating a machining plan in an embodiment of the present application. Detailed Description of the Embodiments

[0064] To make the purpose, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0065] The following will detail the technical solutions provided by each embodiment of the present application in conjunction with the drawings.

[0066] As Figure 1 and Figure 2 shown, the embodiment of the present application provides a method for automatically generating a machining plan, including:

[0067] S101: Obtain the image data of the product to be machined, and obtain the image features corresponding to the image data through image recognition.

[0068] Specifically, obtain the image data of the product to be processed; the image data includes machining image data and blank image data. Among them, the blank image data refers to the image of the workpiece before machining, and the machining image data refers to the image of the workpiece after machining. As Figure 3 shown, based on the outer blank image data and with the same center point, the corresponding machining image data can be added.

[0069] For the machining image data and the blank image data, perform image recognition respectively to obtain the corresponding machining contour data and blank contour data. As Figure 3 shown, generally speaking, the outer contour is the blank contour data, and the inner contour is the machining contour data. Here, the inner machining contour data is called contour A, and the outer blank contour data is called contour B.

[0070] For the machining contour data and the blank contour data, perform vertex detection respectively, and perform segmentation processing according to the detected vertices to extract the corresponding image features. The image features can include features corresponding to the image such as vertices, line segments, and the overall contour (for example, position, length, area, etc.).

[0071] Furthermore, for each contour data (including machining contour data and blank contour data), after performing vertex detection and obtaining the corresponding vertices, based on the polygon approximation algorithm (such as the Douglas - Peucker algorithm), the vertices can be screened to delete redundant vertices and retain key vertices, thereby simplifying the contour (when simplifying the contour, only the number of vertices is simplified, and the line segments are not simplified, but the length, shape, etc. of the original line segments are retained).

[0072] At this time, perform segmentation processing on the contour data according to the key nodes, and the corresponding line segments can be obtained. As Figure 3 shown, contour A can be split into line segments A1 - A10, and contour B can be split into line segments B1 - B4.

[0073] S102: According to the image features, determine the machining allowance area of the product to be processed, and perform matching in the product database according to the machining allowance area.

[0074] The machining allowance area refers to the area that needs to be cut off when machining the blank contour. After cutting off this machining allowance area, the remaining is the area corresponding to the machining contour. At this time, according to the difference between the machining contour data and the blank contour data, the machining allowance area can be obtained.

[0075] In the embodiment of the present application, Figure 3For example, the Z-axis is the rotation axis, and the cross-sectional view of the product is observed at this time. For the descriptions of the machining allowance area, sub-areas, vertices, line segments, etc. in the embodiments of the present application, without special instructions, they can all be considered as the corresponding areas, vertices, and line segments on this cross-section.

[0076] In some cases, there may be an overlap between the machining profile data and the blank profile data. At this time, the overlapping line segments can be ignored, and the corresponding machining allowance areas can be generated separately.

[0077] The product database contains the image features of products that have been machined in history, or products generated and verified by technicians, as well as the corresponding machining plans for these products. The machining plan includes the selected cutting tools, tool paths, etc.

[0078] 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 machined products. If the product to be machined can match a completely similar product in the product database, the existing machining plan can be reused. If there is only partial matching, only the matched part can be reused.

[0079] However, in this comparison method, the contour data of the products being compared is large, and it is difficult to find very similar other products between products of different models and batches.

[0080] 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, through the comparison of the sub-areas, the parts similar to the sub-areas can be selected more quickly, and the product to be machined can be processed in a segmented manner, increasing the probability of similar hits in the sub-areas.

[0081] Specifically, the machining allowance area is divided into multiple sub-areas. For each sub-area, corresponding sub-features are generated according to the image features, and the sub-features are matched in the product database. Among them, based on the obtained image features, according to the vertices and line segments included in the sub-area, the corresponding sub-features can be extracted from the image features.

[0082] Furthermore, when dividing the sub-areas, considering that the machining sequence in the actual machining process is usually carried out according to the line segments of the machining profile data, so when actually dividing the sub-areas, the line segments corresponding to the machining profile data can be used as the basis for division. One line segment corresponding to the machining profile data corresponds to one sub-area, and one sub-area corresponds to one machining plan. In this way, when actually designing the tool path, each movement of the cutting tool can complete the machining of one line segment corresponding to the machining profile data, which is more in line with the actual working conditions.

[0083] Based on this, the first vertices and first line segments corresponding to the machining profile data, as well as the second vertices and second line segments corresponding to the blank profile data, are determined.

[0084] For the first vertex, if the distance between this first vertex and the nearest second vertex is lower than the preset distance, a mapping relationship is established between this first vertex and this second vertex. If the distance between this first vertex and the nearest second vertex is higher than the preset distance, this first vertex is projected onto the nearest second line segment, and a mapping relationship is established between this first vertex and the projection point.

[0085] The vertices with the established mapping relationships are connected to obtain the third line segment.

[0086] The purpose of establishing the mapping relationship is to find other vertices that are relatively close to each first vertex. If there is a relatively close second vertex, directly select this vertex. If there is no relatively close second vertex, select the nearest projection point through projection. Then connect the two as the second line segment.

[0087] During 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 finally generated second line segment cannot be too long, resulting in too long an approach distance and affecting the machining quality.

[0088] At this time, for each first line segment, corresponding sub-areas are obtained according to the second line segment and the third line segment.

[0089] According to different actual situations, the shapes of the combined sub-areas are also different. For the first line segment, if the mapping relationships of the first vertices at both ends are both the same second vertex, then the sub-area is a triangle at this time, which does not include the second line segment. If the mapping relationships of the first vertices at both ends have at least one being a mapping point, the sub-area is a quadrilateral, which may be a rectangle, a trapezoid, etc., and it includes the complete or partial second line segment.

[0090] Of course, in the second line segment of the mapping relationship, the situation of passing through the machining profile data usually does not occur. If it does occur, other second vertices or mapping points are replaced in turn according to the distance from small to large until this requirement is met.

[0091] However, in the actual machining process, some special situations may also occur.

[0092] For the first situation, for some special sub-areas that are difficult to directly divide (such as a separately set opening area), they can be marked manually.

[0093] For the second case, according to the angle between the first line segments, it is determined that there is a concave part in the machining profile data. At this time, generating sub-regions in the previous manner will cause chaotic overlap between the sub-regions.

[0094] Based on this, among the first vertices, the specified vertices corresponding to the concave part are determined, and the outermost first specified vertex and the inner second specified vertex are determined among the specified vertices. The determination methods of the first specified vertex and the second specified vertex can be based on the distances between the vertices and the rough profile data and the angle (which is an acute angle) of the first line segment at that vertex.

[0095] For the first specified vertex, if the distance between the first specified vertex and the second vertex with the closest distance is lower than the preset distance, a mapping relationship is established between the first specified vertex and the second vertex. That is to say, for the outermost first specified vertex, the mapping relationship is still established in the previous manner.

[0096] For the second specified vertex, if a mapping relationship is continued to be established, it will cause chaos in the establishment of sub-regions, so no mapping relationship is established anymore.

[0097] At this time, for the concave part, all the first line segments included therein are combined as a single first line segment, which is used to be combined with the second line segment and the third line segment to obtain the corresponding sub-region. That is to say, the sub-region generated at this time may be a polygon, a part of which is the single first line segment obtained by combining the first line segments, and then it also includes the third line segment formed by the mapping relationships 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.

[0098] For the third case, if the area of the sub-region is too small, it will also cause too many tool feed times, thus wasting work efficiency.

[0099] 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.

[0100] Among them, the area of the region being lower than the preset area is divided into two sub-cases. The first sub-case is as Figure 3 shown. Since the A5 and A7 line segments are far from the second vertex, the projection method is selected. However, since it is 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, this sub-region can be directly discarded.

[0101] For other smaller sub-regions, they can be fused. When fusing a sub-region, select other sub-regions with longer common edges for fusion, thereby reducing the working feed length of the tool path. And if the single fused sub-region is a concave polygon, abandon this fusion to reduce the working difficulty of the tool.

[0102] S103: For the first sub-region with successful matching, obtain the matching first processing plan in the product database.

[0103] If a completely similar product can be matched in the database for this product, reuse the existing processing plan. The first processing plan can include: the feed path of the tool, cutting speed, feed rate, cutting depth, etc.

[0104] Here, this existing first processing plan can be directly applied to the actual processing of the first sub-region.

[0105] S104: For the second sub-region with failed matching, select a matching tool and response parameters according to the image features corresponding to the second sub-region, and generate a second processing plan.

[0106] As Figure 3 shown, the Z-axis is the rotating axis. Among them, the three line segments A5, A6, and A7 form an outer circular ring groove. Assuming that the corresponding sub-region is the second sub-region with failed matching, then select a corresponding grooving tool according to the distance between the A5 and A7 line segments. For the A1 line segment, it is an inner hole, and an appropriate internal hole turning tool can be selected according to the inner hole size. At the same time, automatically select appropriate parameters according to the corresponding dimensional tolerance markings, roughness, etc.

[0107] For different image features, corresponding program templates can be set up and sorted out in advance. Among them, those related to dimensions use variable strings, such as:

[0108] N42 G01 {startZ} {f}

[0109] N43 G01 {diameter}

[0110] N44 G01 {endZ}

[0111] The read results are startZ = -781, diameter = 3372, endZ = -779.5, f = 0.55

[0112] Substitute the results to generate the actual code. The following is the generated code snippet:

[0113] N32 ; Rough turning the end face and outer circle

[0114] N33 ; 80-degree rhombus right-hand tool

[0115] N34 ;R1.6

[0116] N39 M3

[0117] N40 M08

[0118] N41 G04 F5

[0119] N42 G01 Z-781 F0.55

[0120] N43 G01 X1686

[0121] N44 G01 Z-779.5

[0122] N45 G00 X2000 Z-200

[0123] N46 M05 M09

[0124] N47 M00

[0125] N48 LSE

[0126] N49 LSS

[0127] N50 ;Verify the end face allowance

[0128] N51 G00 Z-200

[0129] N52 G00 X1784 Z-778

[0130] N53 G96 S105 LIMS=63

[0131] N54 M3

[0132] N55 M08

[0133] In this way, the corresponding second processing plan can be generated.

[0134] S105: Combine and generate the product processing plan corresponding to the product to be processed according to the first processing plan and the second processing plan.

[0135] When combining, for adjacent sub-regions, if the types of the selected tools are the same, the processing plans of these two sub-regions can be merged into a second processing plan, thus improving the work efficiency.

[0136] Of course, corresponding functions can also be added. For example, a probe measurement benchmark program can be added to automatically measure the reference plane, hole positions, or features of the workpiece through the probe, reducing human error. According to the tolerance judgment, trial cut codes are automatically added for precision machining, thus adding a trial cut step before formal machining to verify whether the cutting parameters are reasonable. After the trial cut is completed, the probe is used to measure the dimensions, and automatic compensation is performed based on the measurement results. By measuring the actual dimensions after the trial cut and comparing them with the theoretical values, the tool compensation is automatically corrected. For special precision requirements, compensation values are added, allowing operators to make changes, and there is a maximum compensation anti-fooling mechanism to prevent over-tolerance. Tool life calculation is carried out, and tool insert replacement nodes are added according to the tool machining distance.

[0137] For example, the following is a code snippet for the tool insert replacement node added:

[0138] N111 LSE

[0139] N112 LSS

[0140] N113 ; Replace tool insert

[0141] N114 G00 Z-200

[0142] N115 G00 X1042.625 Z-523.73

[0143] N116 G96 S115 LIMS=63

[0144] N117 M3

[0145] N118 M08

[0146] After obtaining the final product processing plan, production guidance documents such as program files and program sheets can be output according to specifications, and the newly recognized features are automatically stored in the database to enrich the product library and feature library. For completely new features, manual programming can be carried out, and the operation results can be stored in the database after manual programming.

[0147] During the process of product and feature matching, multiple product and technical solutions can also be provided and sorted according to the matching degree. Users can select appropriate solutions 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.

[0148] 1. High degree of automation, including several key steps such as feature recognition, tool selection, and processing plan reuse, greatly reducing the difficulty of technical document compilation and improving the compilation speed.

[0149] 2. By adding a comparison function between the blank contour and the machining contour, most of the steps that require manual operation are replaced by software judgment, making the plan process smooth.

[0150] 3. It has low dependence on the technical level of technicians, digitalizes the accumulated experience in technician training, and can be directly reused.

[0151] 4. Since the blank, machining profile, and tool are automatically selected simultaneously, basic simulation verification can be carried out, which can ensure that the generated tool path will not cause collisions during actual use and guarantee the code quality.

[0152] In one embodiment, when adding image features to the product database and performing matching in the product database according to sub-features, direct matching through image features can be selected.

[0153] However, this matching method requires a large amount of computing power. As the data stored in the product database increases, it will increase the system burden and reduce the matching speed.

[0154] Based on this, when constructing the product database, each historical sub-region corresponding to the historical processed product is obtained. Or, for some manually identified sub-regions, they can also be directly added to the product database.

[0155] For the historical sub-region, determine its corresponding shape data, as well as the vertices and line segments it contains, and perform normalization processing. The shape data, vertices, and line segments can be obtained through the process of obtaining image features in the above text. The shape data can be understood as the contour data corresponding to the sub-region. Here, in order to distinguish it from the machining profile data and blank profile data, it is called shape data.

[0156] Normalization processing can eliminate the influence of translation, rotation, and scaling. For example, translate to the origin, scale to unit size, and align based on the main direction. Of course, it is necessary to mark which line segment is the first line segment. When performing similarity matching comparison, no matter which comparison method is used, the first line segment needs to be aligned before matching.

[0157] For the shape data, vertices, and line segments of the historical sub-region, extract the corresponding image features respectively, and perform quantization processing on the image features. The image features can also be understood as geometric features, and their corresponding geometric attributes can include: global features obtained from the shape data (such as perimeter, area, aspect ratio of the minimum bounding rectangle), and local features obtained from the vertices and line segments (such as relative position and angle of key vertices, polar coordinates of vertices, topological structure, etc.).

[0158] For quantization processing of length (such as perimeter, radius, etc.), it can be divided into N intervals and represented by characters respectively. For angle (such as vertex angle), it can be divided into M directions and also represented by characters respectively.

[0159] In order to distinguish global features and local features, the global features can be represented by different character rules.

[0160] Encode the quantization features obtained after quantization processing to obtain feature codes, and establish corresponding indexes based on the feature codes and store them in the product database.

[0161] In this way, the feature codes are stored in the product database. During actual comparison, the comparison is also performed through the feature codes. The complexity of string comparison is much lower than geometric calculation, so the matching speed is faster. And there is no need for complex matrix operations, only string operations and hash table queries are required, the code volume is small, and the required computing resources are small. And through the corresponding hierarchical matching and quantization rules, the global and local features can be taken into account to ensure the accuracy of the matching result.

[0162] Furthermore, when encoding, the quantization features obtained after quantization processing can be determined first.

[0163] For the first quantization features corresponding to vertices and line segments, splice them in vertex order to obtain local feature codes. For example, if the vertex polar coordinates are (r = 7, θ = 3), the local feature code obtained after quantization and encoding is 7C. Then, in vertex order (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. In this way, the complete local feature code obtained is: 7C-5D-2A...

[0164] At this time, add the second quantization feature corresponding to the shape data to the head of the local feature code to obtain the global feature code. For example, perimeter = 85, area = 30, and the corresponding global feature code is 85 + 30. At this time, the final coding example is 85-30-7C-5D-2A...

[0165] Associate the global feature code with the processing scheme corresponding to the historical sub-region, and establish an index based on the global feature code and store it in the product database. In this way, during matching, first quickly screen according to the global feature code, and then match according to the local feature code, so as to screen out similar (for example, the similarity exceeds the preset threshold) products and realize the dynamic update process of multi-level matching.

[0166] As Figure 4 shown, the embodiment of the present application also provides a processing scheme automatic generation device, including:

[0167] At least one processor; and,

[0168] A memory communicatively connected to the at least one processor; wherein,

[0169] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the machining plan automatic generation method as described in any of the above embodiments.

[0170] An embodiment of the present application further provides a non-volatile computer storage medium storing computer-executable instructions, and the computer-executable instructions are set to be the machining plan automatic generation method as described in any of the above embodiments.

[0171] The various embodiments in the present application are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other. 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 refer to the partial description of the method embodiments.

[0172] The device and medium provided by the embodiments of the present application correspond one by one to the method. Therefore, the device and medium also have beneficial technical effects similar to those of the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be elaborated here.

[0173] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A method for automatically generating a processing plan, characterized in that: include: Acquiring image data of the product to be processed, and acquiring image features corresponding to the image data through image recognition, specifically comprising: acquiring image data of the product to be processed; the image data comprises processing image data and blank image data; performing image recognition on the processing image data and the blank image data, respectively, to acquire corresponding processing contour data and blank contour data; performing vertex detection on the processing contour data and the blank contour data, respectively, and performing segmentation processing according to the detected vertices, to extract corresponding image features; Determine the machining allowance area of ​​the product to be processed according to the image features, and match in the product database according to the machining allowance area, specifically including: obtaining the machining allowance area according to the 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-areas, generate corresponding sub-features according to the image features, and match in the product database according to the sub-features; 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: 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.

3. The method for automatically generating a processing plan according to claim 1, 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.

4. The method for automatically generating a processing plan according to claim 3, 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.

5. The method for automatically generating a processing plan according to claim 3, 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.

6. The method for automatically generating a processing plan according to claim 1, 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.

7. The method for automatically generating a processing plan according to claim 6, 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.

8. 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 processing plans as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Numerical control machine tool workpiece machining allowance determining method based on image recognition

    CN114708587A