OMI path optimization method and system based on heuristic and TS, medium and equipment
By optimizing the in-machine measurement path using heuristic and tabu search algorithms, the problem of excessive measurement time in existing technologies is solved, achieving efficient path planning and detection and reducing costs.
Patent Information
- Application Number
- CN202511263839.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2026-01-23
AI Technical Summary
Existing technologies for machine measurement suffer from excessively long measurement times, especially in batch inspection of parts. Existing methods cannot effectively address the issue that the time for solving the measurement path increases exponentially with the number of measurement points.
An OMI path optimization method based on heuristics and tabu search (TS) is adopted. By constructing an initial set of marker bits and a set of measurement points, the measurement path and the set of points are iteratively optimized, and the final path is optimized by combining the tabu search algorithm.
While ensuring the optimal measurement path, the solution efficiency was significantly improved, the overall complexity was reduced, and the component inspection time was shortened, thus achieving cost reduction and efficiency improvement.
Smart Images

Figure CN121383922A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of in-machine measurement technology, and in particular to an OMI path optimization method, system, medium, and device based on heuristics and TS. Background Technology
[0002] On-machine inspection (OMI) is a technology that uses machine tools as a platform, employing equipment such as probes and tool setters, along with measurement software, to detect the geometric features of workpieces in real time during machining and guide process improvements. As the requirements for product quality, intelligence, and production efficiency in the machinery manufacturing industry continue to increase, the practice of using on-machine inspection for part quality inspection is becoming increasingly common. However, on-machine inspection suffers from excessively long measurement times in batch inspection of parts, which significantly increases inspection costs. To improve the speed of on-machine inspection, one approach is to enhance the quality of the on-machine inspection path planning.
[0003] Most research on path optimization focuses only on the decisive factor affecting measurement time, namely the total distance of the measurement path. However, in machine measurement, the measurement path needs to be planned among multiple points, traversing all points with the shortest total distance. Furthermore, the distribution of measurement points in machine measurement is closely related to the features being measured. Features of the same type but different sizes typically only differ in the number of measurement points planned, while the distribution structure remains unchanged (measurement points are usually relatively uniformly or completely uniformly distributed on the surface of the feature being measured). If the point distribution structure remains unchanged, but the scale of the measurement points is increased, the time complexity of using a local search algorithm to find the optimal measurement path increases factorially. This means that as the point scale increases, the proportion of solutions reached by the local search algorithm among all feasible solutions decreases exponentially, which obviously greatly affects the quality of the local search algorithm's solutions. While increasing the number of measurement points with the point distribution structure unchanged only scales the shape of the optimal measurement path, the time complexity of the local search algorithm is greatly increased. Therefore, as the scale of measurement points increases in machine measurement, the number of feasible paths increases exponentially, resulting in a huge time cost for finding the optimal path. Existing methods are unable to solve the problem that the solution time for finding the optimal measurement path increases exponentially with the number of measurement points while keeping the distribution structure of the measurement points unchanged. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide an OMI path optimization method, system, medium and device based on heuristics and TS, which can guarantee the optimal measurement path and improve the solution efficiency under a variety of common and different measured features.
[0005] To address the aforementioned technical problems, this invention provides an OMI path optimization method based on heuristics and TS, comprising: Obtain all measurement points measured on-machine to obtain an initial set of measurement points, and construct an initial set of marker bits; An initial measurement path is constructed by combining the points in the initial set of initial marker bits and the initial set of initial measurement points, and the set of measurement points is updated based on the initial measurement path. The measurement path and measurement point set are iteratively optimized. In each iteration, points are selected from the measurement point set to be added to the measurement path based on the distance between points in the measurement path and measurement point set. The measurement path and measurement point set are updated, and the flag bit set is updated based on the updated measurement path. The process continues until the measurement point set is empty. The measurement path obtained at this point is then used as a candidate path. Return to the step of constructing the initial measurement path by combining the points in the initial set of marker bits and the initial set of measurement points, and continue until the set of marker bits contains all measurement points, then return to obtain all candidate paths; Select the shortest path from all candidate paths as the initial path for the tabu search, optimize the initial path using the tabu search algorithm, and use the optimized path as the final measurement path.
[0006] Furthermore, the step of constructing the initial measurement path by combining the points in the initial set of marker bits and the initial set of measurement points specifically involves randomly selecting a point in the initial set of measurement points that is not in the initial set of marker bits to obtain the initial measurement path.
[0007] Furthermore, updating the measurement point set according to the initial measurement path specifically involves deleting points from the initial measurement point set from the initial measurement point set to obtain an updated new measurement point set.
[0008] Furthermore, when updating the measurement path and the set of measurement points, the method for updating the measurement path is as follows: Let Path(n) be the measurement path in the nth optimization and N(n) be the set of measurement points. In the nth optimization, calculate the nearest point in N(n) for each point in Path(n) and form an intermediate set, denoted as NP(n). Iterate through each point in NP(n), and denote the i-th point in NP(n) as c. i (n) Find the path in Path(n) that is at a distance of c. i (n) The nearest point, denoted as T, is c i (n) Insert it into Path(n) according to its positional relationship with T, and calculate the increase in the length of Path(n) at this time; Compare the increase in the length of Path(n) after adding each point in NP(n), and select the c that minimizes the increase in the length of Path(n). i (n) Insert c at this time i (n) The resulting Path(n) is used as the updated measurement path.
[0009] Furthermore, the aforementioned c i (n) Insert it into Path(n) according to its positional relationship with T, specifically: Find c in the initial set of measurement points i (n) The relative positions of T and c are determined according to these relative positions. i (n) Insert it into the position before or after T in Path(n).
[0010] Furthermore, when updating the measurement path and the set of measurement points, the method for updating the set of measurement points is as follows: Removing T from N(n) yields the updated set of measurement points.
[0011] Furthermore, the step of updating the set of marker bits according to the updated measurement path specifically involves: The updated set of markers is obtained by adding the first and last points of the updated measurement path to the marker set.
[0012] This invention also provides an OMI path optimization system based on heuristics and TS, comprising: The initial set construction module obtains all measurement points measured on-machine to get the initial measurement point set, and constructs the initial marker bit set; it combines the points in the initial marker bit set and the initial measurement point set to construct the initial measurement path, and updates the measurement point set according to the initial measurement path. The measurement path and measurement point set iterative update module performs iterative optimization on the measurement path and measurement point set. In each iteration, points are selected from the measurement point set to be added to the measurement path based on the distance between points in the measurement path and measurement point set, the measurement path and measurement point set are updated, and the marker bit set is updated based on the updated measurement path. In the candidate path construction module, when the measurement path and measurement point set iterative update module iteratively optimizes the measurement path and measurement point set, if the measurement point set is empty, the measurement path obtained at this time is taken as a candidate path; the step of constructing the initial measurement path by combining the points in the initial flag bit set and the initial measurement point set is returned until the flag bit set contains all measurement points, and all candidate paths are obtained. The measurement path optimization module selects the shortest path from all candidate paths as the initial path for the tabu search, optimizes the initial path using the tabu search algorithm, and uses the optimized path as the final measurement path.
[0013] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a heuristic and TS-based OMI path optimization method.
[0014] The present invention also provides an OMI path optimization device based on heuristics and TS, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements an OMI path optimization method based on heuristics and TS.
[0015] Compared with the prior art, the above-described technical solution of the present invention has the following advantages: This invention generates measurement paths heuristically by using marker bits and distances between measurement points, which can quickly obtain optimal measurement paths for unordered measurement points. Based on this, a tabu search algorithm is used to perform secondary optimization on the generated measurement paths, resulting in low overall complexity and effectively improving solution efficiency while ensuring the optimal measurement path. Attached Figure Description
[0016] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart of a preferred embodiment of the present invention.
[0017] Figure 2 This is a flowchart illustrating the process steps of a method in a preferred embodiment of the present invention.
[0018] Figure 3 This is an example diagram illustrating path optimization using the method of the present invention in a preferred embodiment of the present invention. Detailed Implementation
[0019] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0020] Reference Figure 1 , Figure 2 As shown, this invention discloses an OMI path optimization method based on heuristics and TS, comprising the following steps: S1: Obtain all measurement points measured on-machine to obtain the measurement point set, denoted as N(n), where n represents the nth optimization. N(n) uses a sequential list to store all points and the two corresponding flag bits for each point. Construct a flag bit set, denoted as Flag(n), and denote the initial flag bit set as Flag(0). The initial flag bit set is empty, i.e., Flag(0) = {}.
[0021] In this embodiment, Figure 3 Taking the measurement point shown as an example, Figure 3 P1, P2, ..., P 15 To obtain 15 measurement points, Figure 3 In the grid, the horizontal coordinates 0, 2, ..., 12 represent a horizontal distance of 2 units, and the vertical coordinates 0, 1, ..., 5 represent a vertical distance of 1 unit. Let the initial set of measurement points be N(0), N(0) = {P1...} (0) (false,false),…,P i (0) (false,false),,...,P 15 (0) (false,false),},P i (0) (false, false) represents the three-dimensional spatial coordinates of the i-th measurement point in the initial set of measurement points, and (false, false) are two marker bits, used to indicate whether the point has been deleted and to simulate the set of marker bits.
[0022] S2: Construct the measurement path and update the set of measurement points: Construct a measurement path, denoted as Path(n). Path(n) uses a sequential list structure and stores the index of the point in N. Randomly select a point from the initial measurement point set N(0) that is not in the initial flag set Flag(0) (in this embodiment, P1 is selected as an example) to obtain the initial measurement path, denoted as Path(1), i.e., Path(1) = {P1}. Delete the selected initial point P1 from N(0), at which point N(1) = N(0) - Path(1); or remove P1 from N(0). (0) (false, false) should be changed to P1 (0) (true,true), resulting in N(1).
[0023] Starting from the second optimization (i.e., n=2,3,4,…), the measurement path and measurement point set are updated based on a heuristic algorithm.
[0024] S3: Calculate the intermediate set, denoted as NP(n): In the nth optimization, the nearest point in N(n) for each point in Path(n) is calculated and formed into an intermediate set, denoted as NP(n). That is, each point in NP(n) comes from N(n), and n represents the number of times the set Path is updated.
[0025] In this embodiment, during the second optimization, NP(1) = {P5}. An octree can be used to accelerate the calculation of the nearest point. An octree allows for easy insertion and deletion of points without requiring a complete rebuild. The distance between two points can be approximated using straight-line distance. If a high path length requirement is needed, the distance between two points on the surface corresponding to the measured feature can be used.
[0026] S4: Update the measurement path and measurement point set: Iterate through each point in NP(n), and denote the i-th point in NP(n) as c. i (n) Find the path in Path(n) that is at a distance of c. i (n) The nearest point, denoted as T, is found in the initial set of measurement points N(0) where c i (n) The relative positions of T and c are determined according to these relative positions. i (n) Calculate the increase in the length of Path(n) when inserting T at the position before or after T in Path(n); Compare the increase in the length of Path(n) after adding each point in NP(n), and select the c that minimizes the increase in the length of Path(n). i (n) If the path lengths are the same, keep the first one and insert c. i (n) The updated Path(n) is used as the measurement path, denoted as Path(n+1), and T is removed from N(n) to obtain N(n+1).
[0027] In this embodiment, during the second optimization, each point in NP={P5} is traversed. Since there is only one point, P5 is inserted before or after the nearest point of P5. At this time, the path {P1,P5} is generated. Since there is only one path, {P1,P5} is retained, that is, Path(2)={P1,P5}. In N(1), P5(false,false) is deleted or the P5 flag is modified to (false,true) to obtain N(2).
[0028] S5: Update the flag set: Add the first and last points of Path(n+1) to the flag set Flag(n) to obtain the updated flag set Flag(n+1). Or modify the P5 flag to (true, true) in N(2).
[0029] S6: Determine whether N(n+1) is an empty set at this time, or determine whether the first flag bit of all points in N(n+1) is true. If so, execute S7; otherwise, return to execute S3.
[0030] S7: Update the candidate path set: Add the current Path(n+1) to the candidate path set.
[0031] S8: Determine whether Flag(n+1) contains all measurement points, or whether the second flag bit of all points in N(n+1) is true. If so, execute S9, at which point all candidate paths are obtained; otherwise, return to execute S2, and reconstruct the initial measurement path by randomly selecting a point that is not in the initial flag bit set Flag (0) (not the case of P1), and obtain the next candidate path.
[0032] S9: Select the initial path for the tabu search: Select the shortest path from the candidate path set as the initial path for the tabu search.
[0033] S10: Optimize the initial path of the tabu search using the Tabu Search (TS) algorithm, and use the optimized path as the final measurement path. The program ends. In this embodiment, the classic tabu optimization algorithm is used to randomly adjust the order of measurement points in each iteration, resulting in the final measurement path {P1, P5, P2, P6, P3, P7, P4, P...}. 11 ,P 10 ,P 15 ,P 14 ,P 13 ,P 12 P1→P5→P2→P6→P3→P7→P4→P9}, that is, P1→P5→P2→P6→P3→P7→P4→P 11 →P 10 →P 15 →P 14 →P 13 →P 12 →P8→P9.
[0034] This invention also discloses an OMI path optimization system based on heuristics and TS, comprising: The initial set construction module obtains all measurement points measured on-machine to get the initial measurement point set, and constructs the initial marker bit set; it combines the points in the initial marker bit set and the initial measurement point set to construct the initial measurement path, and updates the measurement point set according to the initial measurement path. The measurement path and measurement point set iterative update module performs iterative optimization on the measurement path and measurement point set. In each iteration, points are selected from the measurement point set to be added to the measurement path based on the distance between points in the measurement path and measurement point set, the measurement path and measurement point set are updated, and the marker bit set is updated based on the updated measurement path. In the candidate path construction module, when the measurement path and measurement point set iterative update module iteratively optimizes the measurement path and measurement point set, if the measurement point set is empty, the measurement path obtained at this time is taken as a candidate path; the step of constructing the initial measurement path by combining the points in the initial flag bit set and the initial measurement point set is returned until the flag bit set contains all measurement points, and all candidate paths are obtained. The measurement path optimization module selects the shortest path from all candidate paths as the initial path for the tabu search, optimizes the initial path using the tabu search algorithm, and uses the optimized path as the final measurement path.
[0035] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an OMI path optimization method based on heuristics and TS.
[0036] The present invention also discloses an OMI path optimization device based on heuristics and TS, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the OMI path optimization method based on heuristics and TS.
[0037] The on-machine measurement path planned in this invention uses a unified algorithm to plan a path that passes through all points and has the shortest total distance among various measured features (common features include lines, planes, circles, cylinders, cones, spheres, circular grooves, square grooves, etc.) that are relatively evenly distributed.
[0038] This invention heuristically generates measurement paths using marker bits and distances between measurement points, enabling rapid acquisition of optimal measurement paths for unordered measurement points. It is applicable to unordered measurement points distributed across features such as cylinders, planes, cones, rings, lines, ellipses, and circles. Furthermore, a tabu search algorithm is used to perform secondary optimization on the generated measurement paths, resulting in low overall complexity. This addresses the issue of the solution time increasing exponentially with the number of measurement points when finding the optimal measurement path, effectively improving efficiency while ensuring the measurement path remains optimal. This method for obtaining the optimal measurement path can significantly reduce the inspection time of parts during on-machine measurement, achieving cost reduction and efficiency improvement.
[0039] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0040] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0041] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0042] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0043] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A heuristic and TS-based OMI path optimization method, characterized in that, include: Obtain all measurement points measured on-machine to obtain an initial set of measurement points, and construct an initial set of marker bits; An initial measurement path is constructed by combining the points in the initial set of initial marker bits and the initial set of initial measurement points, and the set of measurement points is updated based on the initial measurement path. The measurement path and measurement point set are iteratively optimized. In each iteration, points are selected from the measurement point set to be added to the measurement path based on the distance between points in the measurement path and measurement point set. The measurement path and measurement point set are updated, and the flag bit set is updated based on the updated measurement path. The process continues until the measurement point set is empty. The measurement path obtained at this point is then used as a candidate path. Return to the step of constructing the initial measurement path by combining the points in the initial set of marker bits and the initial set of measurement points, and continue until the set of marker bits contains all measurement points, then return to obtain all candidate paths; Select the shortest path from all candidate paths as the initial path for the tabu search, optimize the initial path using the tabu search algorithm, and use the optimized path as the final measurement path.
2. The OMI path optimization method based on heuristics and TS according to claim 1, characterized in that: The method of constructing the initial measurement path by combining the points in the initial set of initial marker bits and the initial set of initial measurement points is as follows: randomly select a point in the initial set of initial measurement points that is not in the initial set of initial marker bits to obtain the initial measurement path.
3. The OMI path optimization method based on heuristics and TS according to claim 1, characterized in that: The step of updating the measurement point set according to the initial measurement path specifically involves deleting points from the initial measurement point set from the initial measurement point set to obtain an updated new measurement point set.
4. The OMI path optimization method based on heuristics and TS according to claim 1, characterized in that: When updating the measurement path and the set of measurement points, the method for updating the measurement path is as follows: Let Path(n) be the measurement path in the nth optimization and N(n) be the set of measurement points. In the nth optimization, calculate the nearest point in N(n) for each point in Path(n) and form an intermediate set, denoted as NP(n). Iterate through each point in NP(n), and denote the i-th point in NP(n) as c. i (n) Find the path in Path(n) that is at a distance of c. i (n) The nearest point, denoted as T, is c i (n) Insert it into Path(n) according to its positional relationship with T, and calculate the increase in the length of Path(n) at this time; Compare the increase in the length of Path(n) after adding each point in NP(n), and select the c that minimizes the increase in the length of Path(n). i (n) Insert c at this time i (n) The resulting Path(n) is used as the updated measurement path.
5. The OMI path optimization method based on heuristics and TS according to claim 4, characterized in that: The term c i (n) Insert it into Path(n) according to its positional relationship with T, specifically: Find c in the initial set of measurement points i (n) The relative positions of T and c are determined according to these relative positions. i (n) Insert it into the position before or after T in Path(n).
6. The OMI path optimization method based on heuristics and TS according to claim 4, characterized in that: When updating the measurement path and the set of measurement points, the method for updating the set of measurement points is as follows: Removing T from N(n) yields the updated set of measurement points.
7. The OMI path optimization method based on heuristics and TS according to claim 1, characterized in that: The step of updating the set of marker bits according to the updated measurement path specifically involves: The updated set of markers is obtained by adding the first and last points of the updated measurement path to the marker set.
8. An OMI path optimization system based on heuristics and TS, characterized in that, include: The initial set construction module obtains the initial measurement point set by acquiring all measurement points measured on-machine and constructs the initial marker bit set. An initial measurement path is constructed by combining the points in the initial set of initial marker bits and the initial set of initial measurement points, and the set of measurement points is updated based on the initial measurement path. The measurement path and measurement point set iterative update module performs iterative optimization on the measurement path and measurement point set. In each iteration, points are selected from the measurement point set to be added to the measurement path based on the distance between points in the measurement path and measurement point set, the measurement path and measurement point set are updated, and the marker bit set is updated based on the updated measurement path. In the candidate path construction module, when the measurement path and measurement point set iterative update module iteratively optimizes the measurement path and measurement point set, if the measurement point set is empty, the measurement path obtained at this time is taken as a candidate path. Return to the step of constructing the initial measurement path by combining the points in the initial set of marker bits and the initial set of measurement points, and continue until the set of marker bits contains all measurement points, and then return to obtain all candidate paths; The measurement path optimization module selects the shortest path from all candidate paths as the initial path for the tabu search, optimizes the initial path using the tabu search algorithm, and uses the optimized path as the final measurement path.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the heuristic and TS-based OMI path optimization method as described in any one of claims 1-7.
10. An OMI path optimization device based on heuristics and TS, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the heuristic and TS-based OMI path optimization method as described in any one of claims 1-7.
