CN-122023314-A - Method, system, computer readable storage medium and computer program product for automatic pairing of workpieces
Abstract
The invention relates to the technical field of industrial automation and discloses a method, a system, a computer readable storage medium and a computer program product for automatically pairing workpieces, wherein the method comprises the steps of collecting surface point clouds of a batch of workpieces to be paired; and pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list in sequence by a dynamic double-pointer algorithm until any dynamic list is empty, and outputting the pairing result of all the workpieces in the batch. According to the invention, the effective pairing quantity of the workpieces is maximized in a single batch through a simple data processing flow and a quick matching logic, and the single workpieces only participate in pairing once so as to avoid repeated allocation, so that the efficiency of a factory assembly line can be obviously improved, and the reject ratio is reduced.
Inventors
- PAN WEI
- QIU JIAJUN
- TANG YARU
- CAO LING
- LU SHENGLIN
Assignees
- 广东奥普特科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260126
Claims (12)
- 1. A method for automatically pairing workpieces based on surface point cloud geometric features and a dynamic double pointer algorithm, comprising the steps of: Collecting surface point clouds of a batch of workpieces to be paired, wherein the batch of workpieces comprise N assemblies and M intermediate workpieces, the assemblies are formed by assembling first workpieces and second workpieces, and an installation gap for installing the intermediate workpieces is formed in the assemblies or between the first workpieces and the second workpieces; based on the collected surface point cloud data, respectively calculating the minimum gap of the installation gap of each assembly body and the maximum thickness of each intermediate workpiece; the method comprises the steps of carrying out descending order on all minimum gaps to construct a first dynamic list, and carrying out descending order on all maximum thicknesses to construct a second dynamic list; And sequentially pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list through a dynamic double-pointer algorithm until any dynamic list is empty, and outputting pairing results of all workpieces in the batch.
- 2. The method for automatically pairing workpieces based on the surface point cloud geometric features and the dynamic double-pointer algorithm according to claim 1, wherein the pairing of the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list is sequentially performed by the dynamic double-pointer algorithm until any dynamic list is empty, and pairing results of all workpieces in the batch are output, specifically: setting double pointers a and b to point to the head of the first dynamic list and the head of the second dynamic list respectively, and pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list in sequence, wherein the pairing rule is as follows: According to the minimum gap in the current pairing item of the first dynamic list pointed by the pointer a and the maximum thickness in the current pairing item of the second dynamic list pointed by the pointer b, calculating the assembly allowance of the workpiece, wherein the calculation formula is as follows: ; wherein Tolerance is the assembly allowance of the workpiece, minD (i,j) is the minimum gap of the assembly body, maxT (k) is the maximum thickness of the intermediate workpiece, and E is the preset assembly allowance; judging whether the assembly allowance is more than or equal to 0; if yes, the pairing is successful, the current pairing items of the first dynamic list and the second dynamic list are deleted, and the pointers a and b are moved down by one bit; If not, the pairing fails, only the current pairing item of the second dynamic list is deleted, and the pointer b moves down by one bit.
- 3. The method for automatically pairing workpieces based on the surface point cloud geometric features and the dynamic double pointer algorithm according to claim 2, wherein the method for calculating the minimum gap of the installation gap of each assembly and the maximum thickness of each intermediate workpiece based on the collected surface point cloud data comprises the following steps: Based on the collected surface point cloud data of each assembly, calculating the minimum gap of the installation gap of each assembly, and constructing a ternary array [ A i ,B j ,MinD (i,j) ]; wherein MinD (i,j) is the minimum gap of the mounting gap of the assembly, a i is the number of the first workpiece, and B j is the number of the second workpiece; Based on the collected surface point cloud data of each intermediate workpiece, calculating the maximum thickness of each intermediate workpiece and constructing a binary array [ C k ,Max (k) ]; and the descending order of all the maximum thickness is ordered, and a second dynamic list is constructed, specifically: Sequencing all the triples according to the sequence from the minimum gap to the minimum gap, and constructing a first dynamic list; and sequencing all the binary arrays according to the order of the maximum thickness from large to small to construct a second dynamic list.
- 4. A method for automatically pairing a workpiece based on a surface point cloud geometry and a dynamic double pointer algorithm according to claim 3, wherein the minimum gap MinD (i,j) is calculated by: calculating the distances between all corresponding position acquisition points of the first workpiece and the second workpiece at the installation gap to obtain a gap sequence of the installation gap; Taking the minimum value in the gap sequence as the minimum gap, and recording the corresponding serial number A i of the first workpiece and the serial number B j of the second workpiece; the calculation method of the maximum thickness MaxT (k) comprises the following steps: Calculating the distances among all corresponding position acquisition points of the intermediate workpiece to obtain a thickness sequence of the intermediate workpiece; And taking the maximum value in the thickness sequence as the maximum thickness, and recording the number C k of the corresponding intermediate workpiece.
- 5. The method for automatically pairing workpieces based on the surface point cloud geometric features and the dynamic double pointer algorithm according to claim 4, wherein the collecting the surface point cloud of a batch of workpieces to be paired specifically comprises: Fitting the first surface of the first workpiece corresponding to the installation gap part and the second surface of the second workpiece corresponding to the installation gap part by adopting a least square method to obtain a first fitting surface and a second fitting surface: Uniformly sampling the first fitting surface and the second fitting surface simultaneously to obtain m pairs of corresponding position acquisition points; fitting the surfaces of the two opposite sides of the intermediate workpiece in the thickness direction by adopting a least square method to obtain a first intermediate workpiece fitting surface and a second intermediate workpiece fitting surface; and uniformly sampling the first intermediate workpiece fitting surface and the second intermediate workpiece fitting surface simultaneously to obtain n pairs of corresponding position acquisition points.
- 6. A system for automatically pairing workpieces based on surface point cloud geometric features and a dynamic double pointer algorithm, comprising: The device comprises a point cloud sampling module, a point cloud sampling module and a processing module, wherein the point cloud sampling module is used for collecting surface point clouds of a batch of workpieces to be paired, the batch of workpieces comprises N assemblies and M intermediate workpieces, the assemblies are formed by assembling a first workpiece and a second workpiece, and an installation gap for installing the intermediate workpieces is formed in the assemblies or between the first workpiece and the second workpiece; the point cloud data processing module is electrically connected with the point cloud sampling module and is used for respectively calculating the minimum gap of the installation gap of each assembly body and the maximum thickness of each intermediate workpiece based on the collected surface point cloud data; The list construction module is electrically connected with the point cloud data processing module and is used for carrying out descending order sequencing on all the minimum gaps to construct a first dynamic list, and carrying out descending order sequencing on all the maximum thicknesses to construct a second dynamic list; And the pairing module is electrically connected with the list construction module and is used for sequentially pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list through a dynamic double-pointer algorithm until any dynamic list is empty, and outputting the pairing result of all workpieces in the batch.
- 7. The system for automatically pairing workpieces based on the surface point cloud geometric features and the dynamic double pointer algorithm according to claim 6, wherein the pairing module is specifically configured to set double pointers a and b to point to the head of the first dynamic list and the head of the second dynamic list respectively, and pair the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list in sequence, and the pairing rule is that: According to the minimum gap in the current pairing item of the first dynamic list pointed by the pointer a and the maximum thickness in the current pairing item of the second dynamic list pointed by the pointer b, calculating the assembly allowance of the workpiece, wherein the calculation formula is as follows: ; wherein Tolerance is the assembly allowance of the workpiece, minD (i,j) is the minimum gap of the assembly body, maxT (k) is the maximum thickness of the intermediate workpiece, and E is the preset assembly allowance; judging whether the assembly allowance is more than or equal to 0; if yes, the pairing is successful, the current pairing items of the first dynamic list and the second dynamic list are deleted, and the pointers a and b are moved down by one bit; If not, the pairing fails, only the current pairing item of the second dynamic list is deleted, and the pointer b moves down by one bit.
- 8. The system for automatically pairing a workpiece based on a surface point cloud geometrical feature and a dynamic double pointer algorithm according to claim 7, wherein the point cloud data processing module is specifically configured to: Based on the collected surface point cloud data of each assembly, calculating the minimum gap of the installation gap of each assembly, and constructing a ternary array [ A i ,B j ,MinD (i,j) ]; wherein MinD (i,j) is the minimum gap of the mounting gap of the assembly, a i is the number of the first workpiece, and B j is the number of the second workpiece; Based on the collected surface point cloud data of each intermediate workpiece, calculating the maximum thickness of each intermediate workpiece and constructing a binary array [ C k ,Max (k) ]; the list construction module is specifically configured to: Sequencing all the triples according to the sequence from the minimum gap to the minimum gap, and constructing a first dynamic list; and sequencing all the binary arrays according to the order of the maximum thickness from large to small to construct a second dynamic list.
- 9. The system for automatically pairing a surface point cloud geometric feature with a dynamic double pointer algorithm workpiece according to claim 8, wherein the minimum gap MinD (i,j) is calculated by the following method: calculating the distances between all corresponding position acquisition points of the first workpiece and the second workpiece at the installation gap to obtain a gap sequence of the installation gap; Taking the minimum value in the gap sequence as the minimum gap, and recording the corresponding serial number A i of the first workpiece and the serial number B j of the second workpiece; the calculation method of the maximum thickness MaxT (k) comprises the following steps: Calculating the distances among all corresponding position acquisition points of the intermediate workpiece to obtain a thickness sequence of the intermediate workpiece; And taking the maximum value in the thickness sequence as the maximum thickness, and recording the number C k of the corresponding intermediate workpiece.
- 10. The system for automatically pairing a workpiece based on a surface point cloud geometrical feature and a dynamic double pointer algorithm according to claim 9, wherein the point cloud sampling module is specifically configured to: Fitting the first surface of the first workpiece corresponding to the installation gap part and the second surface of the second workpiece corresponding to the installation gap part by adopting a least square method to obtain a first fitting surface and a second fitting surface: Uniformly sampling the first fitting surface and the second fitting surface simultaneously to obtain m pairs of corresponding position acquisition points; fitting the surfaces of the two opposite sides of the intermediate workpiece in the thickness direction by adopting a least square method to obtain a first intermediate workpiece fitting surface and a second intermediate workpiece fitting surface; and uniformly sampling the first intermediate workpiece fitting surface and the second intermediate workpiece fitting surface simultaneously to obtain n pairs of corresponding position acquisition points.
- 11. A computer readable storage medium having stored therein at least one instruction for loading and execution by a processor to implement a method of surface point cloud geometry based auto-pairing with a dynamic double pointer algorithm workpiece as claimed in any one of claims 1 to 5.
- 12. A computer program product comprising computer program/instructions which, when executed by a processor, implements a method of automatically pairing a surface point cloud geometrical feature with a dynamic double pointer algorithm based workpiece as claimed in any of claims 1 to 5.
Description
Method, system, computer readable storage medium and computer program product for automatic pairing of workpieces Technical Field The present invention relates to the field of industrial automation technology, and in particular, to a method, a system, a computer readable storage medium and a computer program product for automatically pairing workpieces. Background In industrial assembly production, a large number of parts are required to be functionally matched according to assembly tolerance and clearance requirements so as to ensure assembly precision and product performance. For example, three workpieces (a first workpiece, a second workpiece and an intermediate workpiece) related to the application need to be cooperatively combined to form a mechanical matching structure capable of realizing relative reciprocating motion. The mechanical matching structure needs that the thickness of the middle workpiece is smaller than the installation clearance reserved by an assembly body formed by combining the first workpiece and the second workpiece, and can ensure that the mechanical matching structure has normal assemblability and relative reciprocating motion capability. Currently, existing workpiece allocation methods mainly depend on: (1) The efficiency is low and the error is large; (2) Simple sequencing matching (such as greedy method and violent matching) is that the optimal pairing quantity cannot be ensured for massive batches of workpieces, and bad products are very easy to cause; (3) The complex global optimization algorithm has high time complexity and is not suitable for the production line environment with multiple parallel machines and high real-time performance. Therefore, there is a need in the art for an automatic workpiece pairing method that is computationally efficient, maximizes the number of pairs, and has good robustness to real machining errors. Disclosure of Invention The present invention is directed to a method, system, computer-readable storage medium, and computer program product for automatic pairing of workpieces, which solve or at least partially solve the above-mentioned technical problems. To achieve the purpose, the invention adopts the following technical scheme: in a first aspect, the present invention provides a method for automatically pairing workpieces based on surface point cloud geometric features and a dynamic double pointer algorithm, comprising: Collecting surface point clouds of a batch of workpieces to be paired, wherein the batch of workpieces comprise N assemblies and M intermediate workpieces, the assemblies are formed by assembling first workpieces and second workpieces, and an installation gap for installing the intermediate workpieces is formed in the assemblies or between the first workpieces and the second workpieces; based on the collected surface point cloud data, respectively calculating the minimum gap of the installation gap of each assembly body and the maximum thickness of each intermediate workpiece; the method comprises the steps of carrying out descending order on all minimum gaps to construct a first dynamic list, and carrying out descending order on all maximum thicknesses to construct a second dynamic list; And sequentially pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list through a dynamic double-pointer algorithm until any dynamic list is empty, and outputting pairing results of all workpieces in the batch. Optionally, the pairing of the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list is sequentially performed through a dynamic double pointer algorithm until any dynamic list is empty, and a pairing result of all workpieces in the batch is output, which specifically includes: setting double pointers a and b to point to the head of the first dynamic list and the head of the second dynamic list respectively, and pairing the minimum gap in the first dynamic list and the maximum thickness in the second dynamic list in sequence, wherein the pairing rule is as follows: According to the minimum gap in the current pairing item of the first dynamic list pointed by the pointer a and the maximum thickness in the current pairing item of the second dynamic list pointed by the pointer b, calculating the assembly allowance of the workpiece, wherein the calculation formula is as follows: ; wherein Tolerance is the assembly allowance of the workpiece, minD (i,j) is the minimum gap of the assembly body, maxT (k) is the maximum thickness of the intermediate workpiece, and E is the preset assembly allowance; judging whether the assembly allowance is more than or equal to 0; if yes, the pairing is successful, the current pairing items of the first dynamic list and the second dynamic list are deleted, and the pointers a and b are moved down by one bit; If not, the pairing fails, only the current pairing item of the second dynamic list is deleted, and the pointer b moves d