Part profile measurement path planning method, device and equipment and storage medium
Through teaching and learning algorithms, a measurement path planning model is generated, which solves the problem of low detection efficiency in the existing technology and achieves more efficient and accurate part model detection.
Patent Information
- Application Number
- CN202510057130.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, the part shape detection efficiency is low by using ant colony algorithm and the like after uniform sampling of the part shape surface.
The model measurement points are sorted using teaching and learning algorithms to generate a measurement path planning model. Through iterative teaching and learning of the initial solution, the target solution is determined to obtain the shortest path.
Improve the efficiency and accuracy of the three-coordinate measurement/detection of part shape surfaces, and quickly and accurately obtain the optimal measurement path of the shape measurement point.
Smart Images

Figure CN120160579A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital detection of mechanical parts, and particularly relates to a method, device, equipment and storage medium for planning a measurement path of a part surface. Background Art
[0002] The surface features of mechanical parts mainly include two types: planes and curved surfaces. When performing three-coordinate detection on the surface of a mechanical part, the detection process mainly involves two stages: sampling of surface measurement points and sorting of measurement points. Among them, sampling of surface measurement points refers to sampling points on the surface of the part, and sorting of measurement points refers to sorting the sampled points.
[0003] In related technologies, when performing measurement point sampling, generally a sampling distance is set in advance, and then points are sampled evenly on the surface according to the sampling distance. After obtaining the sampled points, generally, an ant colony algorithm or the like is used to sort the sampled points to obtain the final arrangement order.
[0004] However, the above technologies have the problem of low efficiency in surface detection. Summary of the Invention
[0005] The present invention provides a method, device, equipment and storage medium for planning a measurement path of a part surface, so as to solve the defect in the prior art that the detection efficiency of the part surface is relatively low by uniformly sampling the part surface and then using an ant colony algorithm or the like for running, and to achieve the purpose of quickly and accurately obtaining the optimal measurement path of the surface measurement points through a teaching and learning algorithm, thereby improving the efficiency and detection accuracy of three-coordinate measurement / detection of the part surface.
[0006] The present invention provides a method for planning a measurement path of a part surface, including: Obtaining the total number of input sampled points, and performing sampling processing point by point on the target part surface of the part to be measured according to the total number of sampled points to determine a plurality of surface measurement points corresponding to the total number of sampled points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface; Constructing a measurement path planning model according to the total number of sampled points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced when traversing a plurality of surface measurement points under the condition that the total number of sampled points remains unchanged; Generating a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampled points, a plurality of surface measurement points, and a preset number of initial solutions; each initial solution includes an arrangement order of a plurality of surface measurement points, and the latter initial solution among the above-mentioned plurality of initial solutions is determined according to the previous initial solution; Use a preset teaching and learning algorithm to perform teaching processing on multiple initial solutions, determine the candidate solutions after teaching for each initial solution, and determine the target solution corresponding to the measurement path planning model according to each candidate solution; the above target solution includes the target arrangement order of multiple profile measurement points, and the path distance traversed according to the target arrangement order through multiple profile measurement points is the shortest.
[0007] According to a method for planning a measurement path of a part profile provided by the present invention, the above-mentioned sampling process is performed point by point on the target part profile of the part to be measured according to the total number of sampling points to determine multiple profile measurement points corresponding to the total number of sampling points, including: Perform a texture UV sampling on the target part profile to obtain a profile measurement point, and add the profile measurement point to the profile measurement point set to determine the profile measurement point set; Perform a calculation operation, and the above calculation operation includes: performing a UV sampling on the target part profile to obtain a first profile measurement point, and determining whether to add the first profile measurement point to the current profile measurement point set according to the distance between the first profile measurement point and the profile measurement points in the current profile measurement point set; If it is determined to add the first profile measurement point to the current profile measurement point set, then update the current profile measurement point set according to the first profile measurement point, and return to iteratively perform the calculation operation until the number of profile measurement points in the updated profile measurement point set reaches the total number of sampling points.
[0008] According to a method for planning a measurement path of a part profile provided by the present invention, the above-mentioned determination of whether to add the first profile measurement point to the current profile measurement point set according to the distance between the first profile measurement point and the profile measurement points in the current profile measurement point set includes: Calculate the distance between the first profile measurement point and the profile measurement points in the current profile measurement point set, and determine the minimum distance therefrom; If the minimum distance is greater than the preset distance threshold, then add the first profile measurement point to the current profile measurement point set; or, if the minimum distance is not greater than the preset distance threshold, then return to perform the calculation operation.
[0009] According to a method for planning a measurement path of a part profile provided by the present invention, the above-mentioned use of a preset teaching and learning algorithm to perform teaching processing on multiple initial solutions, determine the candidate solutions after teaching for each initial solution, and determine the target solution corresponding to the measurement path planning model according to each candidate solution includes: Perform a teaching operation, and the above teaching operation includes: determining a first initial solution as the teacher according to each initial solution in the current iteration process, constructing a non-linear decreasing function according to the ratio between the current iteration number and the total iteration number, and determining a second initial solution after teaching for each initial solution according to the first initial solution and the non-linear decreasing function; the above first initial solution is the initial solution with the shortest path distance traversed through multiple profile measurement points; Perform a learning operation, where the above learning operation includes: in the current iteration process, for each second initial solution, randomly select a second initial solution from other second initial solutions for learning, and determine the candidate solution after the second initial solution is learned; If the current iteration number has not reached the total iteration number, then use each candidate solution as a new initial solution, return to iteratively execute the above teaching operation and learning operation until the current iteration number reaches the total iteration number, and determine the target solution corresponding to the measurement path planning model based on each candidate solution in the current iteration process.
[0010] According to a part surface measurement path planning method provided by the present invention, the above determining the first initial solution as the teacher according to each initial solution in the current iteration process includes: According to each initial solution in the current iteration process, select a third initial solution from each initial solution; the above third initial solution is the initial solution with the shortest path distance experienced by traversing multiple surface measurement points among multiple initial solutions; Perform Cauchy mutation processing on the third initial solution to determine the fourth initial solution; Obtain the first path distance experienced by traversing multiple surface measurement points corresponding to the third initial solution, and obtain the second path distance experienced by traversing multiple surface measurement points corresponding to the fourth initial solution; If the second path distance is less than the first path distance, then determine the fourth initial solution as the first initial solution; or, if the second path distance is not less than the first path distance, then determine the third initial solution as the first initial solution.
[0011] According to a part surface measurement path planning method provided by the present invention, the above determining the second initial solution after teaching each initial solution according to the first initial solution and the non-linear decreasing function includes: Obtain the path distances corresponding to each initial solution in the current iteration process, and perform mean processing on each path distance to determine the mean distance; According to the non-linear decreasing function, the mean distance, and the first initial solution, determine the second initial solution after teaching each initial solution.
[0012] The present invention also provides a part surface measurement path planning device, including the following modules: A part surface sampling module, configured to obtain the total number of input sampling points, and perform point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points, and determine a plurality of surface measurement points corresponding to the total number of sampling points; the above plurality of surface measurement points cover the entire range of the target part surface; A measurement path planning model construction module is used to construct a measurement path planning model according to the total number of sampling points, the position information of the measuring points on each surface, and the distance between any two measuring points on the surfaces; the above measurement path planning model is a model that satisfies the shortest path distance experienced when traversing multiple surface measuring points under the condition that the total number of sampling points remains unchanged; A model initial solution generation module is used to generate multiple initial solutions corresponding to the measurement path planning model according to the total number of sampling points, multiple surface measuring points, and the preset number of initial solutions; each initial solution includes an arrangement order of multiple surface measuring points, and the latter initial solution in the above multiple initial solutions is determined according to the previous initial solution; A model teaching solution determination module is used to perform teaching processing on multiple initial solutions by using a preset teaching and learning algorithm, determine the candidate solutions after teaching for each initial solution, and determine the target solution corresponding to the measurement path planning model according to each candidate solution; the above target solution includes the target arrangement order of multiple surface measuring points, and the path distance experienced when traversing multiple surface measuring points according to the target arrangement order is the shortest.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the part surface measurement path planning method as described in any one of the above.
[0014] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the part surface measurement path planning method as described in any one of the above.
[0015] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the part surface measurement path planning method as described in any one of the above.
[0016] The part surface measurement path planning method, device, equipment and storage medium provided by the present invention obtain the total number of input sampling points, and perform sampling processing point by point on the target part surface of the part to be measured according to the total number of sampling points, so as to determine a plurality of surface measurement points corresponding to the total number of sampling points and covering the entire range of the target part surface. Then, according to the total number of sampling points, the positions of each surface measurement point, and the distance between any two surface measurement points, a measurement path planning model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points under the condition that the total number of sampling points remains unchanged is constructed. And according to the total number of sampling points, a plurality of surface measurement points, and the preset number of initial solutions, a plurality of initial solutions corresponding to the measurement path planning model are generated. Then, the teaching and learning algorithm is used to perform teaching processing on the plurality of initial solutions to determine the candidate solutions after the initial solution teaching, and the target solution corresponding to the measurement path planning model is determined according to each candidate solution; wherein, each initial solution includes an arrangement order of a plurality of surface measurement points, the latter initial solution of the plurality of initial solutions is determined according to the previous initial solution, the target solution includes the target arrangement order of the plurality of surface measurement points, and the path distance experienced by traversing the plurality of surface measurement points according to the target arrangement order is the shortest. In this method, since the candidate solutions can be obtained by solving the initial solutions for sorting the surface measurement points through the teaching and learning algorithm, and the target solution can be obtained through each candidate solution, the best measurement path of the surface measurement points can be obtained quickly and accurately, thereby improving the efficiency of three-coordinate measurement / detection of the part surface. At the same time, since each initial solution in the initial solutions for solving the measurement path is determined according to the previous initial solution, the diversity of the initial solutions can be improved, the traversability of the teaching and learning algorithm can be enhanced, and thus the accuracy of the finally determined best measurement path and the accuracy of three-coordinate measurement / detection of the part surface can be improved; in addition, since the plurality of surface measurement points covering the entire range of the target part surface are obtained by point-by-point sampling when sampling the surface measurement points, the obtained plurality of surface measurement points are more reasonable and conform to the actual situation, so the accuracy of three-coordinate measurement / detection of the part surface can be further improved. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is one of the flowcharts of the part surface measurement path planning method provided by the present invention.
[0019] Figure 2 It is the second flowchart of the part surface measurement path planning method provided by the present invention.
[0020] Figure 3 It is the effect diagram of the optimal candidate point random sampling algorithm provided by the present invention.
[0021] Figure 4 It is the third schematic flow diagram of the part surface measurement path planning method provided by the present invention.
[0022] Figure 5 It is the effect diagram of the path planning sorting provided by the present invention.
[0023] Figure 6 It is the schematic structural diagram of the part surface measurement path planning device provided by the present invention.
[0024] Figure 7 It is the schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] Currently, when performing measurement point sampling, generally, a sampling distance is set in advance, and then points are sampled evenly on the surface according to the sampling distance. After obtaining the sampling points, generally, an ant colony algorithm or the like is used to sort the sampling points to obtain the final arrangement order. However, although the above-mentioned uniform sampling method obtains a relatively neat arrangement of measurement points, some areas on the part surface may not be covered by sampling points, ultimately resulting in inaccurate measurement or detection of the part surface. At the same time, the above-mentioned ant colony algorithm and the like have a slow iteration speed, which will lead to low efficiency in measuring or detecting the part surface. Based on this, the embodiments of the present invention provide a part surface measurement path planning method, device, equipment and storage medium, which can solve the above technical problems.
[0027] The following will be combined with Figures 1-5 Describe the part surface measurement path planning method of the embodiments of the present invention.
[0028] It should be noted that the execution subject of the embodiments of the present invention can be a part surface measurement path planning device, or an electronic device, or other devices or apparatuses. There is no specific limitation here. The following embodiments will be described by taking an electronic device as an example. The electronic device can be a terminal or a server, and there is no limitation on its specific form here.
[0029] Figure 1It is one of the schematic flowcharts of the part surface measurement path planning method provided by the present invention. As Figure 1 shown, the method includes the following steps: Step 102, obtain the total number of input sampling points, and perform point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points, and determine a plurality of surface measurement points corresponding to the total number of sampling points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface.
[0030] Among them, the three-dimensional model corresponding to the part to be measured (such as 3D CAD) can be obtained first, and then the three-dimensional model is imported into the geometric modeling engine OCC installed on the electronic device for model parsing to obtain the feature information corresponding to the part surface of the part to be measured. The feature information includes the surface identification of the part to be measured, the surface type (including curved surface, plane, etc.) and the association relationship between part surfaces (that is, which specific surfaces are continuous surfaces, etc.). Then, the continuous surface can be selected as the target part surface through the feature information in the surface parsed from the part to be measured.
[0031] At the same time, the user can input the total number of points to be sampled on the target part surface on the electronic device, that is, the total number of sampling points, and then the target part surface can be sampled point by point to sequentially obtain a plurality of surface measurement points equal in number to the total number of sampling points. It should be noted that the plurality of surface measurement points obtained by sampling here can cover the entire range of the target part surface, so there will be no situation where the surface measurement points cannot be covered in some ranges, which is more in line with the actual situation, and thus the accuracy of subsequent part surface detection can also be improved.
[0032] Step 104, construct a measurement path planning model according to the total number of sampling points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points under the condition that the total number of sampling points remains unchanged.
[0033] Among them, the above-mentioned plurality of surface measurement points obtained by sampling are disordered by themselves, that is, there is no arrangement order. For coordinate measurement / detection, a suitable measurement point path can greatly improve the efficiency of the measurement process. Therefore, in this step, a measurement path planning model is established based on this to obtain the optimal measurement point path and the optimal surface measurement point sorting.
[0034] Specifically, after obtaining the above-mentioned plurality of surface measurement points by sampling, the position information of each surface measurement point can also be obtained. The position information can be two-dimensional coordinates or three-dimensional coordinates. Then, based on the position information of any two surface measurement points, the distance between any two surface measurement points can be calculated, and then combined with the total number of sampling points, a measurement path planning model can be constructed. The mathematical expression of the measurement path planning model is as follows: .
[0035] Among them, i represents the number of the section measurement points, m represents the total number of sampling points, and p i represents the i-th section measurement point, and p i+1 represents the (i + 1)-th section measurement point. dis(p i , p i+1 ) represents the distance between the i-th section measurement point and the (i + 1)-th section measurement point, and L represents the path distance experienced by traversing these multiple section measurement points (i.e., the sum of the path distances of traversing the section measurement points). It should be noted that the above formula can also be used as the fitness function in the subsequent teaching and learning algorithm.
[0036] After constructing the above measurement path planning model, the model can be solved. The essence of the solution is to calculate the traversed path distance based on different orderings of multiple section measurement points, and then find an ordering of section measurement points with the shortest traversed path distance from them. The following steps will illustrate the solution process of the model.
[0037] Step 106: Generate multiple initial solutions corresponding to the measurement path planning model according to the total number of sampling points, multiple section measurement points, and the preset number of initial solutions; each initial solution includes an arrangement order of multiple section measurement points, and the subsequent initial solution among the above multiple initial solutions is determined according to the previous initial solution.
[0038] In this step, when solving the above measurement path planning model, multiple initial solutions of the model can be generated first. When specifically generating multiple initial solutions, the number of initial solutions to be generated, that is, the number of initial solutions, can be determined first. This number of initial solutions can be set in advance, and the specific size can be set according to the actual situation, such as setting it to 20, 50, 100, etc. Generally, it does not exceed the total sum of the sorting numbers that can be formed by the above multiple section measurement points.
[0039] At the same time, the total number of sampling points and multiple section measurement points for sampling can also be obtained, and then through methods such as the chaotic mapping mechanism, combined with the number of initial solutions, the first initial solution can be generated (for example, it can be randomly generated, that is, randomly sort the multiple section measurement points to obtain the first initial solution), and then the second initial solution is generated based on the first initial solution, and the third initial solution is generated based on the second initial solution, and so on, until multiple initial solutions reaching the number of initial solutions are generated and then stop.
[0040] Specifically, after generating the first initial solution, the following formula can be used to iteratively generate the subsequent multiple initial solutions based on this first initial solution: .
[0041] Among them, x j,i represents the i-th section measurement point in the j-th initial solution, and xj+1,i It represents the i-th surface measurement point in the (j + 1)-th initial solution, where j is greater than or equal to 1 and less than or equal to the preset number of initial solutions. a and b are control parameters. For example, a can be taken as 0.5 and b can be taken as 0.2. mod is the remainder function.
[0042] Based on the above formula, multiple subsequent initial solutions can be iteratively calculated in sequence from the first initial solution, and each subsequent initial solution is obtained by referring to and calculating based on the previous initial solution. In this way, the traversal path distances between the generated initial solutions are relatively reasonable, which can improve the diversity of the initial solutions, enhance the traversability of the subsequent teaching and learning algorithm, and further improve the efficiency and accuracy of the subsequent model solution.
[0043] It should be noted that each of the above initial solutions corresponds to a permutation order of multiple surface measurement points. The surface measurement points included in each initial solution are the same, and they are all the surface measurement points of the total number of the above sampling points, and the permutation orders of the surface measurement points in each initial solution are different.
[0044] Step 108: Use the preset teaching and learning algorithm to perform teaching processing on multiple initial solutions, determine the candidate solutions after teaching for each initial solution, and determine the target solution corresponding to the measurement path planning model according to the candidate solutions; the above target solution includes the target permutation order of multiple surface measurement points, and the path distance experienced by traversing multiple surface measurement points according to the target permutation order is the shortest.
[0045] In this step, after generating multiple initial solutions, the teaching and learning algorithm can be used to perform iterative teaching and learning processing on the multiple initial solutions. Specifically, it can first perform teaching processing on the multiple initial solutions, that is, determine the initial solution as the teacher (i.e., the one with the shortest traversal path distance) among the multiple initial solutions, and then this teacher initial solution can teach each initial solution to update each initial solution once. Then each initial solution can learn from other initial solutions and then update its own initial solution again. The initial solutions after being updated through teaching and learning processing can be recorded as the candidate solutions for each, thus completing one iteration. Then use the candidate solutions in the previous iteration process as the initial solutions for this round of iteration, and continue to perform teaching and learning processing to continuously update the initial solutions iteratively.
[0046] After obtaining each candidate solution in each iteration process, it is possible to determine whether the current iteration count has reached the total iteration count or whether the shortest traversal path distance among the candidate solutions in the current iteration process is less than the threshold. If the current iteration count reaches the total iteration count or the shortest traversal path distance among the candidate solutions in a certain iteration round is less than the threshold, the iteration process can be stopped. Then, it is possible to obtain each candidate solution in the iteration round when the iteration ends, and then calculate the traversal path distance for each candidate solution, and select the candidate solution corresponding to the shortest traversal path distance as the target solution. The target solution finally obtained includes the target arrangement order of multiple profile measurement points, and the path distance experienced when traversing these multiple target profile measurement points in accordance with the target arrangement order is the shortest, thereby improving the detection efficiency.
[0047] As can be seen from the above description, the number of initial solutions does not change in each iteration process, and the number of multiple profile measurement points included in the initial solutions is also the total number of sampling points and does not change. Only teaching and learning processing are performed during the iteration process. Therefore, this teaching and learning processing process is faster and has higher detection efficiency.
[0048] In this embodiment, by obtaining the total number of input sampling points and performing point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points, a plurality of surface measurement points corresponding to the total number of sampling points and covering the entire range of the target part surface are determined. Then, according to the total number of sampling points, the positions of each surface measurement point, and the distance between any two surface measurement points, a measurement path planning model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points with the total number of sampling points unchanged is constructed. And according to the total number of sampling points, a plurality of surface measurement points, and the preset number of initial solutions, a plurality of initial solutions corresponding to the measurement path planning model are generated. Then, a teaching and learning algorithm is used to perform teaching processing on the plurality of initial solutions to determine candidate solutions after the initial solution teaching, and a target solution corresponding to the measurement path planning model is determined according to each candidate solution; wherein, each initial solution includes an arrangement order of a plurality of surface measurement points, the latter initial solution of the plurality of initial solutions is determined according to the previous initial solution, the target solution includes the target arrangement order of the plurality of surface measurement points, and the path distance experienced by traversing the plurality of surface measurement points according to the target arrangement order is the shortest. In this method, since candidate solutions can be obtained by solving the initial solutions for sorting the surface measurement points through the teaching and learning algorithm, and the target solution can be obtained through each candidate solution, the best measurement path of the surface measurement points can be obtained quickly and accurately, thereby improving the efficiency of three-coordinate measurement / detection of the part surface. At the same time, since each initial solution in the initial solutions for solving the measurement path is determined according to the previous initial solution, the diversity of the initial solutions can be improved, the traversability of the teaching and learning algorithm can be enhanced, and the accuracy of the finally determined best measurement path and the accuracy of three-coordinate measurement / detection of the part surface can be improved; in addition, since a plurality of surface measurement points covering the entire range of the target part surface are obtained by point-by-point sampling when sampling the surface measurement points, the obtained plurality of surface measurement points are more reasonable and conform to the actual situation, so the accuracy of three-coordinate measurement / detection of the part surface can be further improved.
[0049] The following embodiments will illustrate the process of sampling the surface of the part to be measured.
[0050] Figure 2 is the second flowchart of the part surface measurement path planning method provided by the present invention. As Figure 2 shown, the step of "performing point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points to determine a plurality of surface measurement points corresponding to the total number of sampling points" in the above step 102 may include the following steps: Step 202, perform a texture UV sampling on the target part surface to obtain a surface measurement point, add the surface measurement point to the surface measurement point set, and determine the surface measurement point set.
[0051] Among them, UV sampling, that is, texture sampling, refers to the process of sampling color values from a texture map according to UV coordinates. The UV coordinates are a two-dimensional coordinate system, where the U-axis represents the horizontal direction and the V-axis represents the vertical direction, and the value range is usually [0,1].
[0052] When sampling the first measurement point, a UV sampling can be performed on the target part surface to obtain a surface measurement point and its U and V values. The U and V values are respectively obtained by using the randi function (generating uniformly distributed pseudo-random integers).
[0053] After obtaining the first surface measurement point, the surface measurement point can be added to the pre-set surface measurement point set. It can be understood that the surface measurement point set is initially empty, and a set including surface measurement points can be obtained after continuously adding the generated surface measurement points.
[0054] Step 204, perform a calculation operation. The above calculation operation includes: performing a UV sampling on the target part surface to obtain a first surface measurement point, and determining whether to add the first surface measurement point to the current surface measurement point set according to the distance between the first surface measurement point and the surface measurement points in the current surface measurement point set.
[0055] In this step, in order to facilitate the subsequent generated surface measurement points to be more reasonable and be able to reasonably cover the entire range of the target part surface of the part to be measured, subsequent surface measurement points can be iteratively generated based on the surface measurement points already generated in the surface measurement point set.
[0056] Specifically, when generating the second surface measurement point, a calculation operation can be performed. The calculation operation includes: continuing to perform a UV sampling on the target part surface in the above-mentioned manner of generating surface measurement points to obtain a surface measurement point, denoted as the first surface measurement point. At the same time, the current surface measurement point set can be obtained. Then, as an optional embodiment, the distances between the first surface measurement point and the surface measurement points in the current surface measurement point set can be calculated, and the minimum distance can be determined therefrom; that is, the distances between the first surface measurement point generated in the current iteration process and the existing surface measurement points in the surface measurement point set in the current iteration process can be calculated respectively to obtain the distances between the first surface measurement point and each surface measurement point in the current surface measurement point set, and the minimum distance can be found therefrom. Then, the minimum distance is compared with a preset distance threshold. If the minimum distance is greater than the preset distance threshold, the first surface measurement point is added to the current surface measurement point set. The minimum distance being greater than the preset distance threshold indicates that the distance between the first surface measurement point generated in the current iteration process and the generated surface measurement points is reasonable and can be retained, that is, added to the current surface measurement point set to obtain a new surface measurement point set. If the minimum distance is not greater than the preset distance threshold, the calculation operation is returned to be executed, that is, the minimum distance is less than or equal to the preset distance threshold, indicating that the distance between the first surface measurement point generated in the current iteration process and the generated surface measurement points is unreasonable and needs to be discarded, and a new first surface measurement point is regenerated by re-iteration.
[0057] Step 206, if it is determined to add the first surface measurement point to the current surface measurement point set, the current surface measurement point set is updated according to the first surface measurement point, and the iterative execution of the calculation operation is returned until the number of surface measurement points in the updated surface measurement point set reaches the total number of sampling points.
[0058] In this step, whether the first surface measurement point is added to the current surface measurement point set or discarded, the next iteration round will be performed to continue generating the first surface measurement point, that is, the iterative execution of the calculation operation in the above-mentioned step 204 will be returned until the number of surface measurement points in the updated surface measurement point set in the current iteration round reaches the total number of sampling points. At this time, the iteration is terminated, and the finally updated surface measurement point set is retained, that is, multiple generated surface measurement points are obtained.
[0059] It should be noted that the above-mentioned sampling method for surface measurement points in this embodiment can also be called the best candidate point random sampling algorithm. For example, see Figure 3 the effect diagram of the best candidate point random sampling algorithm shown, where each point represents a sampled surface measurement point. It can be seen that the multiple surface measurement points generated by the method of this embodiment are more in line with the actual situation of the part surface and are also more accurate.
[0060] In this embodiment, by calculating the distance between the surface measurement points generated each time and the surface measurement points that have been generated previously, it is determined whether the currently generated surface measurement points are reasonable. In this way, by selecting the optimal side points point by point based on the distance, the multiple surface measurement points finally obtained can be made more reasonable and conform to the actual situation. Therefore, the accuracy of three-coordinate measurement / detection of the part surface can be further improved. In addition, when the minimum distance between the surface measurement points generated each time and the surface measurement points that have been generated previously is greater than the threshold value, it is determined that the currently generated surface measurement points are reasonable. The surface measurement points determined in this way are more reasonable, and the determination process is simple and intuitive. Therefore, the efficiency and accuracy of sampling the part surface can be improved; at the same time, this method can sample and generate a specified number of points on the surface of any shape, so as to expand the applicable range of this sampling method.
[0061] The following embodiments illustrate the process of solving the measurement path planning model through the teaching and learning algorithm.
[0062] Figure 4 is the third schematic flow chart of the part surface measurement path planning method provided by the present invention. As Figure 4 shown, the above step 108 may include the following steps: Step 302, perform a teaching operation. The above teaching operation includes: determining a first initial solution as the teacher according to each initial solution in the current iteration process, constructing a non-linear decreasing function according to the ratio between the current iteration number and the total iteration number, and determining a second initial solution after teaching for each initial solution according to the first initial solution and the non-linear decreasing function; the above first initial solution is the initial solution with the shortest path distance experienced by traversing multiple surface measurement points.
[0063] Among them, the teaching and learning algorithm is also an iterative process. In each round of the iterative process, a teaching operation and a learning operation are both performed, and both the teaching operation and the learning operation will update the initial solution.
[0064] For the above teaching operation, in each round of the iterative process, it may be to first calculate the traversal path distances corresponding to each initial solution in the current iteration process. Specifically, it may be to calculate the traversal path distance corresponding to each initial solution after traversing all the surface measurement points according to the arrangement order of the multiple surface measurement points in each initial solution, using the mathematical expression corresponding to the above measurement path planning model. Then, the shortest traversal path distance can be selected from the traversal path distances, and at the same time, the initial solution corresponding to the shortest traversal path distance is obtained. After that, the initial solution corresponding to the shortest traversal path distance can be directly used as the teacher (denoted as the first initial solution), or the first initial solution can also be obtained by further processing the initial solution corresponding to the shortest traversal path distance.
[0065] After obtaining the first initial solution as the teacher, each initial solution acts as a student, and the teacher can teach each student. Specifically, during teaching, in order to perform adaptive teaching processing according to the knowledge difficulty and student acceptance level in the actual teaching process, in this embodiment, the current iteration number corresponding to the current iteration process can be obtained, and then the ratio of the current iteration number to the total iteration number is calculated, and a non-linear decreasing function is constructed through this ratio. This non-linear decreasing function can also be called a teaching factor. In the current related technologies, the teaching factor generally can only take two values, 0 or 1, which does not conform to the actual teaching situation. The teaching factor constructed in this embodiment is a non-linear decreasing function and can take any value between 0 and 1 according to the actual teaching situation. Specifically, it can enhance the global search ability in the early stage of teaching and enhance the local search ability in the later stage of teaching. In this way, the obtained teaching factor is more in line with the actual teaching situation, and the initial solution after teaching is also more accurate.
[0066] After obtaining the non-linear decreasing function / teaching factor in the current iteration process, each initial solution can be directly taught through the non-linear decreasing function in the current iteration process, and at the same time, combined with the first initial solution as the teacher, the second initial solution after teaching each initial solution is obtained. Additionally, as an optional embodiment, the path distances corresponding to each initial solution in the current iteration process can also be obtained, and the average value processing is performed on each path distance to determine the average distance, and according to the non-linear decreasing function, the average distance, and the first initial solution, the second initial solution after teaching each initial solution is determined; specifically, the second initial solution after teaching can be represented by the following formula: 。
[0067] where rand represents a random function; t represents the current iteration number; T represents the total iteration number; represents a weight factor, which can be set according to the actual situation; x j,best represents the first initial solution in the current iteration round; x j,i represents the j-th initial solution in the current iteration round (or the i-th surface measurement point in the j-th initial solution in the current iteration round), that is, the initial solution before teaching; x’ j,i represents the second initial solution corresponding to the j-th initial solution in the current iteration round (or the i-th surface measurement point in the j-th second initial solution in the current iteration round), that is, the initial solution after teaching; Mean represents the average distance; represents the non-linear decreasing function / teaching factor.
[0068] Step 304, perform a learning operation. The above learning operation includes: in the current iteration process, for each second initial solution, randomly select a second initial solution from other second initial solutions for learning to determine the candidate solution after the second initial solution is learned.
[0069] In this step, for the learning operation, it mainly further improves the accuracy of the initial solutions by mutual tutoring among the second initial solutions after teaching.
[0070] In each iteration process, after performing the teaching operation in this iteration process, multiple second initial solutions after teaching can be obtained. For each second initial solution, a second initial solution can be randomly selected from other second initial solutions except this second initial solution, and they learn from each other to obtain the final solution after mutual learning of this second initial solution, denoted as the candidate solution. Specifically, the following formula can be used to calculate the candidate solution corresponding to each second initial solution: 。
[0071] where, x a represents a second initial solution before mutual learning, x b represents a second initial solution randomly selected before mutual learning, x’ new,a represents the candidate solution of x a after mutual learning in the current iteration round, and rand represents the random function.
[0072] Step 306, if the current iteration number has not reached the total iteration number, then use each candidate solution as a new initial solution, return to iterate and execute the above teaching operation and learning operation until the current iteration number reaches the total iteration number, and determine the target solution corresponding to the measurement path planning model according to each candidate solution in the current iteration process.
[0073] In this step, multiple candidate solutions will be obtained in each iteration process. The number of these multiple candidate solutions is the same as the number of the initially determined multiple initial solutions. After obtaining multiple candidate solutions in each iteration process, it can be judged whether the current iteration number has reached the total iteration number. If not, use the multiple candidate solutions obtained in the current iteration process as the new initial solutions, then return to iterate and execute the teaching operation and learning operation, obtain new multiple candidate solutions, and then judge whether the current iteration number has reached the total iteration number again. If not, continue to iterate.
[0074] When the current iteration number reaches the total iteration number, the multiple candidate solutions obtained in the current iteration process can be obtained, then calculate the traversal path distance corresponding to each candidate solution after traversing all the form surface measurement points, and the shortest traversal path distance can be selected from the traversal path distances, and at the same time obtain the candidate solution corresponding to the shortest traversal path distance, and then use the candidate solution corresponding to the shortest traversal path distance as the target solution (i.e., the optimal solution of the measurement path planning model). At this time, the arrangement order of the form surface measurement points in this target solution is the optimal, and the shortest traversal path distance, that is, the optimal value, can be output.
[0075] Exemplarily, refer to Figure 5 The path planning sorting effect diagram shown in the figure. In this figure, the path composed of blue broken lines is the path that traverses each surface measurement point among the various surface measurement points in the target solution. The path distance of traversing each surface measurement point through this sorting is the shortest, so as to effectively improve the three-coordinate measurement / detection efficiency of the part to be measured.
[0076] In this embodiment, by iteratively performing teaching operations and learning operations on multiple initial solutions, and constructing a non-linear decreasing function based on the ratio of the current iteration number to the total iteration number during the teaching operation to teach each round of initial solutions, the teaching process can be carried out according to the knowledge difficulty and the student acceptance level in the actual teaching process, making the entire teaching process more in line with the actual teaching situation, thereby improving the adaptive search ability of the teaching and learning algorithm in the teaching stage and improving the accuracy of obtaining the optimal target solution. In addition, in the teaching stage, a non-linear decreasing function, the average path distance of each initial solution, and the shortest path distance solution in each initial solution can be used for teaching. After such teaching, the initial solution is more accurate and also more in line with the actual teaching situation.
[0077] In order to avoid the problem that the teaching and learning algorithm is extremely likely to fall into local optimum in the later stage, in this embodiment, it is proposed to increase the diversity of the initial solutions as the teacher in the later iteration process so that the teaching and learning algorithm can break away from local optimum in the later iteration process. The following embodiments will illustrate this process.
[0078] In some embodiments, the step of "determining the first initial solution as the teacher according to each initial solution in the current iteration process" in step 302 above may include the following steps: According to each initial solution in the current iteration process, select a third initial solution from each initial solution; the above-mentioned third initial solution is the initial solution with the shortest path distance experienced by traversing multiple surface measurement points among multiple initial solutions; perform Cauchy mutation processing on the third initial solution to determine a fourth initial solution; obtain the first path distance experienced by traversing multiple surface measurement points corresponding to the third initial solution, and obtain the second path distance experienced by traversing multiple surface measurement points corresponding to the fourth initial solution; if the second path distance is less than the first path distance, then determine the fourth initial solution as the first initial solution; or, if the second path distance is not less than the first path distance, then determine the third initial solution as the first initial solution.
[0079] Specifically, in the current iteration process, the initial solutions in the current iteration process can be obtained first, and then the traversal path distances of each initial solution can be calculated, and the shortest traversal path distance can be selected from them. Then, the initial solution corresponding to the shortest traversal path distance can be obtained, and this initial solution is denoted as the third initial solution. At the same time, the shortest traversal path distance corresponding to the third initial solution is denoted as the first path distance. After that, the third initial solution can be processed by Cauchy mutation using the following formula, and the mutated third initial solution is denoted as the fourth initial solution. The Cauchy mutation formula is as follows: 。
[0080] Among them, x new,best represents the fourth initial solution, x best represents the third initial solution, and Cauchy(0, 1) represents Cauchy mutation.
[0081] After obtaining the fourth initial solution, the position information of each surface measurement point in the fourth initial solution after mutation can also be obtained. Then, based on the position information of each surface measurement point after mutation, the traversal path distance of traversing multiple surface measurement points in the fourth initial solution can be calculated using the above traversal distance calculation formula, and it is denoted as the second path distance.
[0082] After that, the first path distance of the third initial solution and the second path distance of the fourth initial solution can be compared. If the second path distance is less than the first path distance, it means that the traversal path distance corresponding to the fourth initial solution is the shortest, that is, the fourth initial solution is better. At this time, the fourth initial solution can be used as the teacher solution in this round of iteration, that is, the first initial solution, that is, the mutated solution replaces the global current global optimal solution, which can expand the search area. If the second path distance is greater than or equal to the first path distance, it means that the traversal path distance corresponding to the third initial solution is the shortest, that is, the third initial solution is better. At this time, the third initial solution can be used as the teacher solution in this round of iteration, that is, the first initial solution.
[0083] In this embodiment, in each round of iteration, the shortest path distance solution selected in this round can be subjected to Cauchy mutation, and then the teacher solution in this round of iteration can be determined by the traversal path distances of the two solutions before and after mutation, which can increase the diversity of the teacher solution and expand the search area during the iteration process, avoid the iteration process falling into local optimum, and thus can improve the accuracy of the finally determined solution.
[0084] In addition, it should be noted that the above Figure 3 and Figure 5 are only examples, and the words therein do not affect the essence of the embodiments of the present invention.
[0085] The part surface measurement path planning device provided by the present invention will be described below. The part surface measurement path planning device described below can be correspondingly referred to the part surface measurement path planning method described above.
[0086] Figure 6 is a schematic structural diagram of the part surface measurement path planning device provided by the present invention. Refer to Figure 6 as shown, the device may include: A part surface sampling module 410, configured to obtain the total number of input sampling points, and perform point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points, and determine a plurality of surface measurement points corresponding to the total number of sampling points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface; A measurement path planning model construction module 420, configured to construct a measurement path planning model according to the total number of sampling points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points when the total number of sampling points remains unchanged; A model initial solution module 430, configured to generate a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampling points, a plurality of surface measurement points, and a preset number of initial solutions; each initial solution includes an arrangement order of a plurality of surface measurement points, and the latter initial solution in the above-mentioned plurality of initial solutions is determined according to the previous initial solution; A model teaching solution module 440, configured to perform teaching processing on a plurality of initial solutions by using a preset teaching and learning algorithm, determine candidate solutions after teaching for each initial solution, and determine a target solution corresponding to the measurement path planning model according to each candidate solution; the above-mentioned target solution includes a target arrangement order of a plurality of surface measurement points, and the path distance experienced by traversing a plurality of surface measurement points according to the target arrangement order is the shortest.
[0087] In some embodiments, the above-mentioned part surface sampling module 410 is specifically configured to perform a texture UV sampling on the target part surface once to obtain a surface measurement point, add the surface measurement point to the surface measurement point set, and determine the surface measurement point set; perform a calculation operation, and the above-mentioned calculation operation includes: performing a UV sampling on the target part surface once to obtain a first surface measurement point, and determining whether to add the first surface measurement point to the surface measurement points in the current surface measurement point set according to the distance between the first surface measurement point and the surface measurement points in the current surface measurement point set; if it is determined to add the first surface measurement point to the current surface measurement point set, update the current surface measurement point set according to the first surface measurement point, and return to iteratively perform the calculation operation until the number of surface measurement points in the updated surface measurement point set reaches the total number of sampling points.
[0088] Optionally, the above-mentioned part surface sampling module 410 is specifically configured to calculate the distance between the first surface measurement point and the surface measurement points in the current surface measurement point set, and determine the minimum distance therefrom; if the minimum distance is greater than the preset distance threshold, add the first surface measurement point to the current surface measurement point set; or, if the minimum distance is not greater than the preset distance threshold, return to perform the calculation operation.
[0089] In some embodiments, the above-mentioned model teaching and solving module 440 is specifically configured to perform teaching operations, and the above-mentioned teaching operations include: determining a first initial solution as the teacher according to the initial solutions in the current iteration process, constructing a non-linear decreasing function according to the ratio between the current iteration number and the total iteration number, and determining the second initial solutions after teaching of each initial solution according to the first initial solution and the non-linear decreasing function; the first initial solution is the initial solution with the shortest path distance experienced by traversing multiple surface measurement points; performing learning operations, and the above-mentioned learning operations include: in the current iteration process, for each second initial solution, randomly select a second initial solution from other second initial solutions for learning, and determine the candidate solutions after learning of the second initial solutions; if the current iteration number has not reached the total iteration number, use each candidate solution as a new initial solution, return to iteratively perform the above-mentioned teaching operations and learning operations until the current iteration number reaches the total iteration number, and determine the target solution corresponding to the measurement path planning model according to the candidate solutions in the current iteration process.
[0090] Optionally, the above-mentioned model teaching and solving module 440 is specifically configured to select a third initial solution from the initial solutions according to the initial solutions in the current iteration process; the third initial solution is the initial solution with the shortest path distance experienced by traversing multiple surface measurement points among the multiple initial solutions; perform Cauchy mutation processing on the third initial solution to determine a fourth initial solution; obtain the first path distance experienced by traversing multiple surface measurement points corresponding to the third initial solution, and obtain the second path distance experienced by traversing multiple surface measurement points corresponding to the fourth initial solution; if the second path distance is less than the first path distance, determine the fourth initial solution as the first initial solution; or, if the second path distance is not less than the first path distance, determine the third initial solution as the first initial solution.
[0091] Optionally, the above-mentioned model teaching and solving module 440 is specifically configured to obtain the path distances corresponding to the initial solutions in the current iteration process, perform mean processing on the path distances to determine the mean distance; determine the second initial solutions after teaching of each initial solution according to the non-linear decreasing function, the mean distance, and the first initial solution.
[0092] It should be noted here that the above device provided by the embodiments of the present invention can implement all the method steps implemented by the above method embodiments and can achieve the same technical effects. Therefore, the same parts and beneficial effects as those in the method embodiments will not be specifically described in this embodiment.
[0093] Figure 7 An example of the physical structure diagram of an electronic device is shown as Figure 7 shown. The electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute the part surface measurement path planning method, which includes: obtaining the total number of input sampling points, and performing point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points to determine a plurality of surface measurement points corresponding to the total number of sampling points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface; constructing a measurement path planning model according to the total number of sampling points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points when the total number of sampling points remains unchanged; generating a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampling points, a plurality of surface measurement points, and a preset number of initial solutions; each initial solution includes an arrangement order of a plurality of surface measurement points, and the latter initial solution in the above-mentioned plurality of initial solutions is determined according to the previous initial solution; using a preset teaching and learning algorithm to perform teaching processing on the plurality of initial solutions, determining the candidate solutions after teaching for each initial solution, and determining the target solution corresponding to the measurement path planning model according to each candidate solution; the above-mentioned target solution includes the target arrangement order of a plurality of surface measurement points, and the path distance experienced by traversing a plurality of surface measurement points according to the target arrangement order is the shortest.
[0094] In addition, when the logical instructions in the above-mentioned memory 530 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0095] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the part surface measurement path planning method provided by the above-mentioned various methods. The method includes: obtaining the total number of input sampling points, and performing point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points to determine a plurality of surface measurement points corresponding to the total number of sampling points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface; constructing a measurement path planning model according to the total number of sampling points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points when the total number of sampling points remains unchanged; generating a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampling points, a plurality of surface measurement points, and a preset number of initial solutions; each initial solution includes an arrangement order of a plurality of surface measurement points, and the latter initial solution in the above-mentioned plurality of initial solutions is determined according to the previous initial solution; using a preset teaching and learning algorithm to perform teaching processing on the plurality of initial solutions, determining candidate solutions after teaching for each initial solution, and determining the target solution corresponding to the measurement path planning model according to each candidate solution; the above-mentioned target solution includes the target arrangement order of a plurality of surface measurement points, and the path distance experienced by traversing a plurality of surface measurement points according to the target arrangement order is the shortest.
[0096] In another aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the part surface measurement path planning method provided by the above-mentioned various methods. The method includes: obtaining the total number of input sampling points, and performing point-by-point sampling processing on the target part surface of the part to be measured according to the total number of sampling points to determine a plurality of surface measurement points corresponding to the total number of sampling points; the above-mentioned plurality of surface measurement points cover the entire range of the target part surface; constructing a measurement path planning model according to the total number of sampling points, the position information of each surface measurement point, and the distance between any two surface measurement points; the above-mentioned measurement path planning model is a model that satisfies the shortest path distance experienced by traversing a plurality of surface measurement points under the condition that the total number of sampling points remains unchanged; generating a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampling points, a plurality of surface measurement points, and a preset number of initial solutions; each initial solution includes an arrangement order of a plurality of surface measurement points, and the latter initial solution in the above-mentioned plurality of initial solutions is determined according to the previous initial solution; using a preset teaching and learning algorithm to perform teaching processing on the plurality of initial solutions, determining candidate solutions after teaching for each initial solution, and determining the target solution corresponding to the measurement path planning model according to each candidate solution; the above-mentioned target solution includes the target arrangement order of a plurality of surface measurement points, and the path distance experienced by traversing a plurality of surface measurement points according to the target arrangement order is the shortest.
[0097] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0098] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A part surface measurement path planning method, characterized in that: include: Obtaining the total number of sampling points inputted, and performing sampling processing point by point on the target part profile of the part to be measured according to the total number of sampling points, and determining a plurality of profile measuring points corresponding to the total number of sampling points; the plurality of profile measuring points covering the entire range of the target part profile; A measurement path planning model is constructed according to the total number of sampling points, the position information of each of the profile measuring points, and the distance between any two profile measuring points; the measurement path planning model is a model that satisfies the shortest path distance experienced by traversing the multiple profile measuring points when the total number of sampling points remains unchanged; Generate multiple initial solutions corresponding to the measurement path planning model according to the total number of sampling points, the multiple surface measurement points and the preset number of initial solutions; each of the initial solutions includes an arrangement order of the multiple surface measurement points, and a subsequent initial solution among the multiple initial solutions is determined according to a previous initial solution; A preset teaching and learning algorithm is used to teach the multiple initial solutions, determine candidate solutions for each of the initial solutions after teaching, and determine a target solution corresponding to the measurement path planning model according to each of the candidate solutions; the target solution includes a target arrangement order of the multiple surface measurement points, and the path distance traversed by traversing the multiple surface measurement points according to the target arrangement order is the shortest.
2. The part surface measurement path planning method according to claim 1, characterized in that: The step of performing sampling processing point by point on the target part profile of the part to be measured according to the total number of sampling points to determine a plurality of profile measurement points corresponding to the total number of sampling points includes: Performing a texture UV sampling on the target part surface to obtain a surface measurement point, and adding the surface measurement point to the surface measurement point set to determine the surface measurement point set; Executing a calculation operation, the calculation operation comprising: performing a UV sampling on the target part profile to obtain a first profile measuring point, and determining whether to add the first profile measuring point to the current profile measuring point set according to the distance between the first profile measuring point and the profile measuring points in the current profile measuring point set; If it is determined to add the first profile measurement point to the current profile measurement point set, the current profile measurement point set is updated according to the first profile measurement point, and the calculation operation is returned to iteratively execute until the number of profile measurement points in the updated profile measurement point set reaches the total number of sampling points.
3. The part surface measurement path planning method according to claim 2, characterized in that: The determining, based on the distance between the first profile measuring point and the profile measuring points in the current profile measuring point set, whether to add the first profile measuring point to the current profile measuring point set comprises: Calculating the distance between the first profile measuring point and the profile measuring points in the current profile measuring point set, and determining the minimum distance therefrom; If the minimum distance is greater than a preset distance threshold, the first profile measuring point is added to the current profile measuring point set; or, if the minimum distance is not greater than the preset distance threshold, the calculation operation is returned to be performed.
4. The part surface measurement path planning method according to any one of claims 1 to 3, characterized in that: The method of using a preset teaching and learning algorithm to perform teaching processing on the multiple initial solutions, determining a candidate solution after each initial solution is taught, and determining a target solution corresponding to the measurement path planning model according to each candidate solution, includes: Execute a teaching operation, the teaching operation comprising: determining a first initial solution as a teacher according to each of the initial solutions in the current iteration process, and constructing a nonlinear decreasing function according to the ratio between the current number of iterations and the total number of iterations, and determining a second initial solution after each of the initial solutions is taught according to the first initial solution and the nonlinear decreasing function; the first initial solution is an initial solution with the shortest path distance experienced by traversing the multiple surface measuring points; Performing a learning operation, the learning operation comprising: in the current iteration process, for each second initial solution, randomly selecting a second initial solution from other second initial solutions for learning, and determining a candidate solution after the second initial solution is learned; If the current number of iterations does not reach the total number of iterations, each candidate solution is used as a new initial solution, and the teaching operation and the learning operation are returned to be iteratively executed until the current number of iterations reaches the total number of iterations, and the target solution corresponding to the measurement path planning model is determined according to each candidate solution in the current iteration process.
5. The part surface measurement path planning method according to claim 4, characterized in that: Determining the first initial solution as the teacher according to each of the initial solutions in the current iteration process includes: According to each of the initial solutions in the current iteration process, a third initial solution is selected from each of the initial solutions; the third initial solution is an initial solution having the shortest path distance traversing the multiple profile measuring points among the multiple initial solutions; Performing Cauchy mutation processing on the third initial solution to determine a fourth initial solution; Obtaining a first path distance corresponding to the third initial solution and traversing the plurality of profile surface measuring points, and obtaining a second path distance corresponding to the fourth initial solution and traversing the plurality of profile surface measuring points; If the second path distance is less than the first path distance, the fourth initial solution is determined as the first initial solution; or if the second path distance is not less than the first path distance, the third initial solution is determined as the first initial solution.
6. The part surface measurement path planning method according to claim 4, characterized in that: The step of determining the second initial solution after each initial solution is taught according to the first initial solution and the nonlinear decreasing function comprises: Obtaining the path distances corresponding to the initial solutions in the current iteration process, and performing mean processing on the path distances to determine the mean distance; According to the nonlinear decreasing function, the mean distance and the first initial solution, a second initial solution after each of the initial solutions is taught is determined.
7. A device for planning a path for measuring a part surface, characterized in that: include: A part surface sampling module is used to obtain the total number of sampling points inputted, and perform sampling processing point by point on the target part surface of the part to be measured according to the total number of sampling points, and determine a plurality of surface measurement points corresponding to the total number of sampling points; the plurality of surface measurement points cover the entire range of the target part surface; A measurement path planning model building module is used to build a measurement path planning model according to the total number of sampling points, the position information of each of the profile measuring points, and the distance between any two profile measuring points; the measurement path planning model is a model that satisfies the shortest path distance experienced by traversing the multiple profile measuring points when the total number of sampling points remains unchanged; A model initial solution module, used to generate a plurality of initial solutions corresponding to the measurement path planning model according to the total number of sampling points, the plurality of profile measuring points and a preset number of initial solutions; each of the initial solutions includes an arrangement order of the plurality of profile measuring points, and a latter initial solution among the plurality of initial solutions is determined according to a former initial solution; The model teaching and solving module is used to use a preset teaching and learning algorithm to teach the multiple initial solutions, determine the candidate solutions of each of the initial solutions after teaching, and determine the target solution corresponding to the measurement path planning model according to each of the candidate solutions; the target solution includes the target arrangement order of the multiple surface measurement points, and the path distance traversed by the multiple surface measurement points according to the target arrangement order is the shortest.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the part surface measurement path planning method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the part profile measurement path planning method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the part profile measurement path planning method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Laser scanning path planning method and device for civil aircraft sheet metal part measurement
CN117968521A
