Efficient laser cutting tool path planning method and related device
By adopting an efficient laser cutting knife path planning method in laser cutting processing, and using the ant colony algorithm to optimize the path, the problem of laser moving for a long time between processing profiles is solved, the production efficiency is improved and multiple path constraints are met.
Patent Information
- Application Number
- CN202411845669.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-02-14
AI Technical Summary
In laser cutting processing, the laser takes longer to move between each processing profile, resulting in inefficient production.
An efficient laser cutting knife path planning method is adopted to obtain part contour images, extract contour nested inclusion relationships, divide contour groups and adjacent contour candidate sets, calculate feature vectors, distance matrix and cross matrix, and use an ant colony algorithm Optimize tool path.
It realizes efficient optimization of laser processing paths, reduces the time of laser movement, improves production efficiency, and meets multiple tool path constraints.
Smart Images

Figure CN119426817A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automobile manufacturing, and in particular to a laser processing path optimization method and related devices. Background Art
[0002] In laser cutting processing, it takes a lot of time for the laser to move between each processing contour. Therefore, laser processing path optimization is the key to improving laser processing production efficiency. Summary of the invention
[0003] In view of the above problems, this application provides an efficient laser cutting tool path planning method and related devices to achieve the purpose of laser processing path optimization. The specific scheme is as follows:
[0004] The first aspect of the present application provides an efficient laser cutting tool path planning method, comprising:
[0005] Acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts respectively;
[0006] Acquire a plurality of contours from the part contour image;
[0007] Acquire a contour nesting inclusion relationship corresponding to a plurality of contours respectively, wherein the contour nesting inclusion relationship of the contour includes all parent contours and all child contours of the contour;
[0008] Based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, a plurality of contour groups are obtained, wherein the plurality of contours included in the contour group have the same parent contour;
[0009] Acquire adjacent contour candidate sets corresponding to the plurality of contours respectively, wherein the adjacent contour candidate set corresponding to the contour includes a first preset number of contours in the contour group to which the contour belongs and which have the shortest distance to the nearest point of the contour;
[0010] For each of the contours, dividing a target contour in an adjacent contour candidate set corresponding to the contour into an adjacent contour set, wherein the target contour includes a sub-contour of the adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour;
[0011] For each contour, determine the key points whose mask attributes are true among the key points corresponding to the contour as mask key points;
[0012] For each of the contour groups, obtain the eigenvector, distance matrix and intersection matrix corresponding to the contour group; the eigenvector includes the number of each of the mask key points in the contours included in the contour group, the number of the contour to which each of the mask key points belongs, the number of the parent contour of the contour to which each of the mask key points belongs, the number of uncut sub-contours of the contour to which each of the mask key points belongs, and whether the contour to which each of the mask key points belongs has been cut; the distance matrix includes the distance between the mask key points in pairs in all the contours included in the contour group; the intersection matrix includes the number of intersections between the lines between the mask key points in pairs in all the contours included in the contour group and other contours in the contour group;
[0013] Based on the characteristic vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups, an efficient laser cutting tool path corresponding to the part contour image is obtained.
[0014] In a possible implementation, the step of obtaining an efficient laser cutting tool path corresponding to the part contour image based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups includes:
[0015] For each of the contours, determining that the mask key points contained in the contour constitute an urban cluster and determining that the mask key points are cities;
[0016] Initializing the number of iterations, setting the upper limit of the number of iterations, and initializing the path pheromone concentration of the paths between all cities included in the plurality of contour groups to 1;
[0017] Initializing the feature vectors respectively corresponding to a plurality of the contour groups;
[0018] For each of the contour groups, the target walking path corresponding to the contour group is obtained based on the ant colony algorithm using the feature vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set; the target walking path is a path from the set cutting starting point corresponding to the contour group to the set cutting end point corresponding to the contour group;
[0019] Obtain parent contours corresponding to each of the plurality of contour groups;
[0020] For each of the contour groups, obtain the key contour to which the second mask key point preceding the first mask key point contained in the parent contour in the target walking path corresponding to the contour group to which the parent contour of the contour group belongs; determine the second mask key point as the updated set starting point of the contour group; determine the first mask key point as the updated set cutting end point of the contour group; and obtain the updated set starting points and updated set cutting end points respectively corresponding to the plurality of contour groups;
[0021] Constructing the efficient laser cutting tool path based on the target walking paths respectively corresponding to the plurality of contour groups and the updated set starting points and the updated set cutting end points respectively corresponding to the plurality of contour groups;
[0022] Update the path pheromone concentration of all paths between cities;
[0023] updating the number of iterations;
[0024] If the number of iterations does not reach the upper limit of the number of iterations, returning to the step of initializing the feature vectors corresponding to the plurality of contour groups respectively;
[0025] If the number of iterations reaches the upper limit number of iterations, the final high-efficiency laser cutting tool path is obtained.
[0026] In a possible implementation, the step of obtaining the target walking path corresponding to the contour group by using the feature vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set based on the ant colony algorithm includes:
[0027] Randomly placing a plurality of ants on any city on the city cluster closest to the set cutting starting point of the contour group;
[0028] For each ant, updating the taboo table of the ant, the taboo table including a set of candidate cities that the ant has not visited, the candidate city set including one or more cities;
[0029] For each ant, if there is a candidate city set in the taboo table corresponding to the ant, calculate the state transition probabilities corresponding to each city included in the candidate city set; randomly select a target city from each city according to the state transition probabilities corresponding to each candidate city; if the taboo table corresponding to the ant is empty, query the distance matrix corresponding to the profile group for the target city that is closest to the city that the ant has not passed through; determine that the target city is the next city that the ant will go to;
[0030] Updating the feature vector of the target city;
[0031] Returning to the step of calculating the state transition probability corresponding to each city included in the candidate city set if there is a candidate city set in the taboo table corresponding to the ant, until all ants have passed through all the city clusters included in the contour group and reached the set cutting end point of the contour group;
[0032] The target walking path corresponding to the shortest displacement is determined from the walking paths corresponding to the plurality of ants.
[0033] In a possible implementation, the step of updating the taboo table of the ant includes:
[0034] Determine the city where the ant is currently located as the target mask key point;
[0035] Detecting whether the contour to which the target mask key point belongs has a parent contour to obtain a first detection result;
[0036] If the first detection result is yes, query from the feature vector corresponding to the target mask key point whether there is an unpassed contour that the ant has not passed in the child contour of the parent contour; if so, divide the unpassed contour into a set of contours to be passed;
[0037] Determine the intersection of the to-be-passed contour set and the adjacent contour set corresponding to the target mask key point as the candidate city cluster set;
[0038] If the set of contours to be passed through is an empty set, dividing the parent contour into the set of candidate city clusters;
[0039] If the first detection result is no, detecting whether the contour to which the target mask key point belongs shares a common edge with other contours to obtain a second detection result;
[0040] If the second detection result is yes, dividing the contours that share the same edge with the contour to which the target mask key point belongs into the candidate city cluster set;
[0041] If the second detection result is no, determining the adjacent contour set of the contour to which the target mask key point belongs as the candidate city cluster set;
[0042] Based on the intersection matrix corresponding to the contour group to which the mask key point where the ant is located belongs, a target key point that has no intersection with the line connecting the target mask key point and the contour that the ant has passed is searched from all the mask key points included in the candidate city cluster set; the taboo table includes the candidate city set composed of the target key points.
[0043] In a possible implementation, the step of calculating the state transition probability corresponding to each city included in the candidate city set includes:
[0044] For each city in the candidate city set, the state transition probability of the city is calculated by the following formula:
[0045] is the city where the ant is currently located; is the target key point, σ(·,·) represents the path pheromone concentration between the two cities, s(·,·) represents the difference in the X-axis coordinate values between the two cities, express The mean of the contour area and the bounding box area of the contour, α, β, γ, and δ represent the importance of the pheromone concentration of the path, the path The importance of , the importance of the ant's advancing direction, and the importance of the mean; Characterize the preset direction priority cutting constraint, Characterize preset small parts priority cutting constraints; path Characterized by arrive Path.
[0046] In a possible implementation, the step of determining the target walking path corresponding to the shortest displacement from the walking paths corresponding to the plurality of ants includes:
[0047] For each of the ants, the formula The displacement of the ant's walking path is calculated; wherein, P S is the position of the cutting starting point, P e is the position of the cutting end point, N r is the number of the mask key points along the path of the ant from the set cutting starting point to the set cutting end point; d(·,·) is a function for calculating the distance between two mask key points; is the i-th mask key point passed by the ant;
[0048] The target walking path corresponding to the shortest displacement is determined from the displacements of the walking paths corresponding to the plurality of ants.
[0049] In a possible implementation, the number of the plurality of ants is N. ant , the step of updating the path pheromone concentration of paths between all cities includes:
[0050] From N ant Among the ants, the one with the smallest displacement on the walking path is obtained. Ants to be updated;
[0051] For each path in the efficient laser cutting tool path By formula:
[0052] Update the path Path pheromone concentration;
[0053] in, θ is the preset pheromone volatilization speed, D′ r,m To update the path After the path pheromone concentration is determined, the displacement of the walking path corresponding to the mth ant to be updated is, is any mask key point in the efficient laser cutting tool path, For the efficient laser cutting tool path The next mask key point of Characterized by arrive Path.
[0054] In a possible implementation, the step of updating the path pheromone concentrations of the paths between all cities further includes:
[0055] like Belong to [σ min , σ max ],Sure For the path Path pheromone concentration;
[0056] like Less than Determine σ min For the path Path pheromone concentration;
[0057] like Greater than Determine σ max For the path Path pheromone concentration.
[0058] In a possible implementation, before the step of updating the path pheromone concentrations of the paths between all cities, the method further includes:
[0059] Determining the efficient laser cutting tool path as a set of paths to be mutated;
[0060] Initialization update times;
[0061] Dividing the path set to be mutated into a first sub-path set and a second sub-path set, wherein the time when the ants pass through the first sub-path set is earlier than the time when the ants pass through the second sub-path set;
[0062] Determine a third mask key point from the first subpath set and determine a fourth mask key point from the second subpath set so that the sum of the first distance and the second distance is minimized; the first distance is the distance between the third mask key point and the fourth mask key point; the second distance is the distance between the third mask key point and the fifth mask key point next to the third mask key point in the path set to be mutated;
[0063] Inserting the third mask key point between the fourth mask key point and the fifth mask key point in the set of paths to be mutated to obtain an updated set of paths to be mutated;
[0064] If the number of updates does not reach Returning to the step of dividing the path set to be mutated into a first sub-path set and a second sub-path set;
[0065] If the number of updates reaches Determine the updated set of paths to be mutated as a target set of mutated paths;
[0066] If the total displacement of the target variant path set is less than the total displacement of the efficient laser cutting tool path, the efficient laser cutting tool path is updated to the target variant path set.
[0067] A second aspect of the present application provides an efficient laser cutting tool path planning device, comprising:
[0068] A first acquisition module is used to acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts;
[0069] A second acquisition module, used for acquiring a plurality of contours from the part contour image;
[0070] A third acquisition module is used to acquire a contour nesting inclusion relationship corresponding to a plurality of contours respectively, wherein the contour nesting inclusion relationship of the contour includes all parent contours and all child contours of the contour;
[0071] A fourth acquisition module, configured to acquire a plurality of contour groups based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, wherein the plurality of contours included in the contour group have the same parent contour;
[0072] A fifth acquisition module, configured to acquire adjacent contour candidate sets corresponding to the plurality of contours, wherein the adjacent contour candidate sets corresponding to the contour include a first preset number of contours in the contour group to which the contour belongs and which have the shortest distance to the nearest point of the contour;
[0073] A first division module is used for dividing, for each of the contours, a target contour in an adjacent contour candidate set corresponding to the contour into an adjacent contour set, wherein the target contour includes a sub-contour of the adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour;
[0074] A sixth acquisition module, for determining, for each contour, key points whose mask attributes are true among the key points corresponding to the contour as mask key points;
[0075] A seventh acquisition module is used to acquire, for each contour group, a feature vector, a distance matrix and a cross matrix corresponding to the contour group; the feature vector includes the number of each mask key point in the contour included in the contour group, the number of the contour to which each mask key point belongs, the number of the parent contour of the contour to which each mask key point belongs, the number of uncut sub-contours of the contour to which each mask key point belongs, and whether the contour to which each mask key point belongs has been cut; the distance matrix includes the distance between the mask key points in all contours included in the contour group; the cross matrix includes the number of intersections between the lines between the mask key points in all contours included in the contour group and other contours in the contour group;
[0076] An eighth acquisition module is used to acquire an efficient laser cutting tool path corresponding to the part contour image based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups.
[0077] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the efficient laser cutting tool path planning method of the above-mentioned first aspect or any implementation method of the first aspect.
[0078] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0079] The memory is used to store computer programs;
[0080] The processor is used to execute the computer program so that the electronic device can implement the efficient laser cutting tool path planning method of the above-mentioned first aspect or any implementation method of the first aspect.
[0081] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement an efficient laser cutting tool path planning method according to the first aspect or any implementation of the first aspect.
[0082] By means of the above technical scheme, the present application provides an efficient laser cutting tool path planning method, which includes obtaining a part contour image; obtaining multiple contours from the part contour image; obtaining the contour nesting inclusion relationship corresponding to the multiple contours; obtaining multiple contour groups based on the contour nesting inclusion relationship corresponding to the multiple contours; obtaining the adjacent contour candidate sets corresponding to the multiple contours; for each contour, dividing the target contour in the adjacent contour candidate set corresponding to the contour into the adjacent contour set; for each contour, obtaining the key points with true mask attributes from the key points corresponding to the contour as mask key points; for each contour group, obtaining the eigenvector, distance matrix and cross matrix corresponding to the contour group; based on the eigenvector, distance matrix, cross matrix and adjacent contour set corresponding to the multiple contour groups, obtaining the efficient laser cutting tool path corresponding to the part contour image. Thus, the purpose of obtaining an efficient laser cutting tool path is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0084] Figure 1 A schematic diagram of a system architecture provided for this application;
[0085] Figure 2 A schematic diagram of an optional hardware structure of a terminal 100 provided in this application;
[0086] Figure 3 A schematic diagram of the structure of a server 200 provided in this application;
[0087] Figure 4 A schematic diagram of a process flow of an efficient laser cutting tool path planning method provided in an embodiment of the present application;
[0088] Figure 5 A schematic diagram of a part contour image provided in an embodiment of the present application;
[0089] Figure 6 A schematic diagram of a process for determining a nested inclusion relationship of profiles provided in an embodiment of the present application;
[0090] Figure 7A schematic diagram of an implementation method of a tree structure provided in an embodiment of the present application;
[0091] Figure 8 A schematic diagram of an implementation method of a profile with self-contained leads provided in an embodiment of the present application;
[0092] Fig. 9 A schematic diagram of the structure of a highly efficient laser cutting tool path planning device for large-scale process parts provided in an embodiment of the present application;
[0093] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0094] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0095] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0096] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0097] The detailed process of laser cutting processing includes: (1) Setting cutting parameters: Setting laser power, cutting speed, focal length and other parameters according to the type and thickness of specific materials. The selection of these parameters will directly affect the cutting effect; (2) Preparing workpiece materials: Checking the size and surface quality of the workpiece materials to ensure that the workpieces meet the processing requirements, and cleaning the workpiece surface to avoid affecting the cutting quality; (3) Setting the coordinate system: Setting the coordinate system of the laser cutting machine according to the requirements of the design drawings, determining the placement position and angle of the parts to ensure the accuracy and consistency of the cutting position; (4) Layout design: Arranging different workpieces according to the requirements of the design drawings (i.e., the part outline images in this application) In terms of workpiece materials, try to increase the utilization rate of workpiece materials, and in the layout process, it is necessary to consider factors such as the spacing between different parts and mutual interference; (5) Laser cutting tool path planning: According to factors such as the shape of the parts and the characteristics of the materials, adjust the cutting path to make the laser cutting blank path as short as possible to ensure that there are no problems such as tool return during the cutting process; (6) Workpiece positioning and fixing: After completing the layout, position and fix the workpiece to ensure that the workpiece will not move or deform during the cutting process; (7) Start the laser cutting machine for processing: During the entire cutting process, it is necessary to pay close attention to the condition of the workpiece and adjust the cutting parameters and path in time to ensure processing quality and efficiency.
[0098] A very important step in the detailed process of laser cutting processing is "laser cutting tool path planning". In the actual laser cutting scene, after the parts are automatically or manually arranged, a workpiece material may contain more than 500 parts of different shapes. These parts may contain a variety of special graphic processes, such as parts with sub-contours, parts with self-leads, and multi-layer nested parts. In addition, the laser cutting tool path needs to meet some constraints, such as priority cutting of adjacent parts, priority cutting of directions, priority cutting of small parts, and priority cutting of common edges. In the end, the generated laser cutting tool path needs to have as small an empty line distance as possible and pass through the cut area as little as possible. In order to apply the laser cutting tool path planning technology to a large-scale process part collection, some improvement measures need to be designed to maximize the computational efficiency of the laser cutting tool path planning technology.
[0099] In the related art, the laser cutting tool path planning method abstracts the problem into a generalized traveling salesman problem and uses the ant colony algorithm to solve it. Specifically, it includes: firstly extracting key points from all contours in the workpiece material as cities in the generalized traveling salesman problem, and all key points in the contours form a city cluster, and then using the ant colony algorithm to find a shortest path, so that this shortest path passes through all city clusters, and only passes through one city in each city cluster. For special graphics processes of parts, such as parts with sub-contours and multi-layer nested parts, the part collection is organized into a tree structure to perform hierarchical calculations of the ant colony algorithm. As for the constraints, such as sub-contour priority cutting, adjacent parts priority cutting, direction priority cutting, and less passing through the cut area, they are added to the taboo table in the ant colony algorithm and the state transition probability of the city in the candidate city set. The defects of the related technology are: (1) parts with built-in leads are not taken into account; (2) there is no quantity constraint on the selection of key points; (3) the constraints of small parts priority cutting and common edge priority cutting are not considered; (4) the constraint of less passing through the cut area will fail in many cases; (5) the related technology has not been specially optimized for large-scale parts collections, and the operating efficiency is low.
[0100] Based on this, this application mainly designs efficient laser cutting tool path planning for large-scale process parts (such as a part set with more than 500 parts). Specifically, in view of the problem that the related art does not consider the parts with self-contained leads and the selection of key points without quantity constraints, this application adds mask attributes to the key points extracted from the parts. If it is a part with self-contained leads, only the real mask attributes are set for the key points in the leads. If it is a small part with a large number of key points, only a small number of the most important key points are set to the real mask attributes to avoid the waste of calculations caused by too many key points. In view of the problem that the related art does not consider the constraints of small parts priority cutting and common edge priority cutting, this application adds common edge constraints to the taboo table of the ant colony algorithm, and adds the part area factor to the state transition probability of the candidate city set. In view of the problem that the constraint of less passing through the cut area will fail in many cases in the related art, this application adds a penalty factor of the number of times the cut area has been passed in the calculation of the displacement of the walking path of the ants in the ant colony algorithm, further strengthening the constraint that the ant colony algorithm does not pass through the cut area. In response to the problem of low efficiency of related technologies on large-scale parts collections, this application designs a number of improvement measures, including: (1) contour grouping; (2) using sparse matrices to save cross-matrices; (3) semi-elite ant pheromone update strategy; (4) maximum-minimum ant strategy; (5) nearest neighbor interpolation mutation algorithm; and (6) automatic stop after convergence.
[0101] In summary, this application takes into account the various special graphic processes that may appear in large-scale parts (such as parts with sub-contours, parts with self-leads, and multi-layer nested parts) and tool path constraints (such as sub-contour priority cutting, adjacent parts priority cutting, direction priority cutting, small parts priority cutting, and common edge priority cutting), and designs an improved ant colony algorithm to make the final efficient laser cutting tool path have as small an empty line distance as possible and pass through the cut area as little as possible. In addition, this application adopts multiple improvement measures to make the improved ant colony algorithm have higher operating efficiency and avoid long-term path planning operations on large-scale parts.
[0102] The present application is described in detail below in combination with system architecture, method and device.
[0103] See also Figure 1 , Figure 1 1 shows a schematic diagram of a system architecture. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.
[0104] Among them, an application can be installed on the terminal 100, and the above application can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the interface, such as a part contour image, and send the above parameters to the server 200. The server 200 can obtain processing results based on the received parameters and return the processing results to the terminal 100.
[0105] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.
[0106] Next describe Figure 1 The product form of the mid-terminal 100;
[0107] The terminal 100 in the embodiment of the present application can be a laser cutting machine, or an electronic device that controls a laser cutting machine, such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not impose any restrictions on this.
[0108] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0109] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 This is merely an example of a terminal and does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0110] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the terminal. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0111] Among them, the input device 132 can receive input data and the like.
[0112] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 may be used to display interfaces, processing results, etc.
[0113] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0114] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0115] Among them, the memory 120 can be used to store software codes related to the efficient laser cutting tool path planning method, the processor 170 can execute the steps of the efficient laser cutting tool path planning method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve corresponding functions.
[0116] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0117] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.
[0118] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0119] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0120] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0121] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0122] Next describe Figure 1 The product form of the server 200;
[0123] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0124] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0125] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0126] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0127] Among them, the memory 204 can be used to store software codes related to the efficient laser cutting tool path planning method, the processor 202 can execute the steps of the efficient laser cutting tool path planning method for the chip, and can also schedule other units to achieve corresponding functions.
[0128] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0129] Reference Figure 4 , Figure 4 A schematic diagram of a process flow of an efficient laser cutting tool path planning method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, an efficient laser cutting tool path planning method provided by an embodiment of the present application may include steps S401 to S409, and these steps are described in detail below.
[0130] Step S401: Acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts.
[0131] like Figure 5 Shown is a schematic diagram of a part contour image provided in an embodiment of the present application.
[0132] Figure 5 This is only an example and does not limit the number of parts included in the part outline image.
[0133] like Figure 5 As shown, the part contour image includes the contours of multiple parts. A contour is a closed figure, mainly surrounded by circles, arcs and straight lines. This application defines a contour as a closed loop (Loop). If there is a contour inside a closed loop, the outer contour is called the parent contour (i.e., the father loop FatherLoop), and the loop inside the contour is called the child contour (i.e., the child loop SonLoop). In actual enterprise processing, an outer contour may have one or more child contours, such as Figure 5 Part i in has a sub-contour; an outer contour may also have no sub-contours, such as Figure 5Part j in has no sub-contours. A sub-contour has only one parent loop. There are three basic elements that form a closed loop: circle, arc, and line segment.
[0134] Step S402: Acquire multiple contours from the part contour image.
[0135] Exemplarily, a contour set including multiple contours can be expressed as H = {L i}(i=1,2,...,N). It can be understood that, combined with Figure 5 It can be seen that the two layers of inner and outer nested contours can form a part.
[0136] Step S403: acquiring contour nesting inclusion relationships respectively corresponding to a plurality of the contours, wherein the contour nesting inclusion relationships of the contours include all parent contours and all child contours of the contours.
[0137] It is understandable that for each contour L i , find L i All child contours and all parent contours of the contour, thereby obtaining the contour nesting containment relationship of the contour.
[0138] It is understandable that it is necessary to calculate the inclusion relationship between every two contours in the contour set H to find the parts and the multi-layer nested relationship between the parts. Figure 6 As shown, it is a schematic diagram of the process of determining the nested inclusion relationship of profiles provided in an embodiment of the present application.
[0139] like Figure 6 As shown, in order to determine the contour L i Is it a contour L j sub-profile, this application will be in profile L i Pick a point P at random i , and construct i A ray with the starting point as the positive direction of the X axis as the direction l i Then, calculate the ray l i With contour L j If the number of intersection points is an odd number, it means that the contour L i In the outline L j Inside, is the outline L j Subcontours of . Figure 6 As shown in Figure (a), the contour L i In the outline L j Inside, ray l i With contour L j The number of intersection points is 1 which is an odd number.
[0140] If the ray l i With contour Lj The number of intersection points is an even number, indicating that the contour L i In the outline L j The outside of the Figure 6 (b) As shown in the figure, the contour L i In the outline L j The outside, ray l i With contour L j The number of intersection points is 2, which is an even number.
[0141] After performing the above calculations on all pairs of contours in the contour set H, we can get each contour L i The child contour collection and parent contour collection of .
[0142] Step S404: Based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, a plurality of contour groups are obtained, wherein the plurality of contours included in the contour group have the same parent contour.
[0143] According to the nested inclusion relationship of the contours, the contour set H is constructed into a tree structure, where every two layers of the tree structure represent a part layer, and the contours of each part layer are grouped. Each contour group obtained is G r ={L i r}(r=1,2,...,R,i=1,2,...,N r ), where R is the number of contour groups, N r The number of contours contained in the contour group. The number of contours contained in different contour groups can be the same or different.
[0144] It is understandable that in actual industrial cutting applications, many plate layout graphics are based on the structure of "large parts embedded in small parts". If all large and small parts of the cutting plate are sorted according to the inclusion relationship, a lot of sorting and searching time will be wasted in sorting between the sub-contours of each large part. Therefore, this application will perform layered processing on this special nested layout graphic, that is, tree structuring. The number of parts contained in the cutting plate may be huge. Grouping the parts according to the nested inclusion relationship of the part contours and the number of each part set (the contours contained in the part set have no parent-child relationship) can greatly reduce the computational complexity of the subsequent ant colony sorting algorithm (if the total number of contours contained in the part set is N, the computational complexity of the ant colony sorting algorithm is o(N*N), but if it is divided into M groups, each group has N / M parts, then the complexity of the ant colony sorting algorithm can be reduced to o(N*N / M)).
[0145] Each contour L i The contour nesting relationship includes a sub-contour set and a parent contour set; after obtaining each contour L iAfter finding the child contour set and parent contour set, the parts and the multi-layer nested relationship between parts can be found according to the containment relationship between contours, and the contours can be grouped. This application can build a tree structure according to the contour nested containment relationship between contours, where each contour will be used as a node of the tree structure. i Node, the number of contours in its parent contour set is L i The number of layers of the node in the tree structure, the contour closest to it in its parent contour set is L i The parent node of the node, and its child contour collection will be constructed into L i After constructing the tree structure of the contour set H, this application will group the contours. Starting from the 0th level of the tree structure, every two levels are a part level. In the same part level, if multiple contours are on the subtree of the same node, the multiple contours will be divided into the same contour group G. r .
[0146] Exemplarily, the method of constructing the contour set H into a tree structure includes the following steps: taking the entire processing plate area as the root node of the tree structure, sequentially taking contour L1 from the contour set H as the first child node of the root node, and connecting L1 with L2, L3, ... N Compare the positional relationships respectively. If L i (i∈2,3…N) has no inclusion relationship with L1, then L1 is stored as a child node of the root node; if L i Contains L1 (i.e. L i L1 is the parent contour of L1, and L1 is stored as L i child nodes, and use L i Replace the node position of L1; if L1 contains L i (i.e. L1 is L i parent contour), then L i Stored as a child node of L1. From L2, L3...L N Take out L j And with L j+1 , L j+2 …L N Compare the inclusion relationship, if L j With L i If there is no inclusion relationship, L will not be changed. i The node position; if L j Contains L i , L i Save as L j If L i Contains L j , then use L i Replace L j The node position and L j Save as Li The child node of L j The subtree itself does not change, and so on, thus obtaining a tree structure.
[0147] In order for those skilled in the art to better understand the tree structure proposed in the embodiments of the present application, the following examples are given to illustrate: Figure 7 The figure is a schematic diagram of an implementation method of the tree structure provided in an embodiment of the present application.
[0148] Combination Figure 7 The implementation method of step S404 includes the following steps A1 to A3.
[0149] Step A1: Based on the nested inclusion relationship of the contours corresponding to the multiple contours, a tree structure is constructed, wherein the child node of any node of the tree structure is the child contour of the contour represented by the node, the parent node of any node is the parent contour of the contour represented by the node, and the root node of the tree structure is the processing plate area.
[0150] Step A2: Acquire multiple part layers from the tree structure, where the part layers include nodes of two adjacent layers in the tree structure.
[0151] like Figure 7 As shown, the root node is the 0th layer, the 1st layer and the 2nd layer constitute the first part layer; the 3rd layer and the 4th layer constitute the second part layer; the 5th layer and the 6th layer constitute the third part layer, and so on.
[0152] Step A3: For each part layer, determine that the nodes in the subtree of the same node located at the i-1th layer in the part layer belong to the same contour group to obtain multiple contour groups; the part layer includes the i-th layer nodes and the i+1-th layer nodes in the tree structure.
[0153] The following takes i=3 as an example for explanation. If i=3, the part layer is the second part layer. It can be understood that in the second part layer, the contour L 17 and contour L 171 The nodes in the subtree of contour L1 in layer 2, so contour L 17 and contour L 171 Constitute a contour group; contour L 21 , outline L 22 , outline L 23 , outline L 221 , outline L 222 The nodes in the subtree of contour L2 in layer 2, so contour L 21 , outline L 22 , outline L 23 , outline L 221 , outline L 222 Constitute a contour group; contour L51 , outline L 52 , outline L 53 , outline L 521 , outline L 522 The nodes belong to the subtree of contour L5 in layer 2, so contour L 51 , outline L 52 , outline L 53 , outline L 521 , outline L 522 Form a contour group.
[0154] For example, if a contour group contains more than 500 contours, the present application will further group the contour group to avoid the problem that the number of contours in the contour group is too large, causing the subsequent distance matrix and cross matrix to occupy too much memory and reduce the calculation efficiency. Specifically, for contour groups with more than 500 contours, the present application will sort the X coordinate value of the lower left corner point of each contour bounding box, and take every 500 contours in the sorted contour group as a new contour group G. r .
[0155] Step S405: Acquire adjacent contour candidate sets corresponding to the plurality of contours respectively, wherein the adjacent contour candidate set corresponding to the contour includes a first preset number of contours in the contour group to which the contour belongs whose distances to the nearest points of the contour are the smallest.
[0156] Exemplarily, the preset number may be determined based on actual conditions and is not limited here.
[0157] Step S406: for each of the contours, dividing the target contour in the adjacent contour candidate set corresponding to the contour into an adjacent contour set.
[0158] The target contour includes a subcontour of an adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour.
[0159] For example, for each contour group G r , calculate the contour group G r Each contour L i r The adjacent contour set M i r ={L j r}(j∈{1,2,...,N 2}).
[0160] It can be understood that after obtaining the contour group G r After that, this application will perform ai r Calculate its adjacent contour set M i r Specifically, this application first calculates the contour group G r The closest point distance between each two contours in L is the distance between the closest points of two contours. It can be understood that the closest point distance between two contours refers to the minimum distance between the two contours; then, for each contour L i r , select the contour L i r The first preset number of contours, such as 10 contours with the smallest nearest point distance, constitutes a candidate set of adjacent contours. i r In the adjacent contour candidate set of L, if there is a point on the contour that is adjacent to the contour L i r If the line segment formed by a point on does not intersect with other contours in the adjacent contour candidate set, then this contour is considered to be contour L i r If the adjacent contour has sub-contours, all sub-contours of the adjacent contour will also be included as contour L. i r Adjacent contours.
[0161] Step S407: for each contour, determine the key points corresponding to the contour whose mask attributes are true as mask key points.
[0162] Exemplarily, the implementation of step S407 includes the following steps B1 to B3.
[0163] Step B1: Acquire a plurality of key point sets corresponding to the contours, wherein the key point sets include a plurality of key points.
[0164] For example, the key point set of each contour can be characterized as: {P ik r}(k=1,2,...,K i r ), where P ik r For the contour L i r The number of key points.
[0165] In order to apply the ant colony algorithm to solve the laser cutting tool path planning problem, it is necessary to extract the key point set {P ik r} as the city set of the ant colony algorithm. Specifically, this application will r Each contour L in i rExtract the edge points of the basic elements (line segments, arcs) as key points. If the contour is a circle, start at 30 degrees on the circle and select a key point every 120 degrees, for a total of 3 key points. If the length of a line segment or arc in the contour exceeds 500mm, taking only the edge points as key points may make the key points not granular enough, resulting in the final tool path not being the optimal result. Therefore, for basic elements (line segments, arcs) with a length exceeding 500mm, this application will also add the midpoints of the basic elements to the key points. However, for common edges (line segment edges that different contours pass through together), the midpoints will not be taken as key points.
[0166] Step B2: setting mask attributes for the key points in the plurality of key point sets respectively.
[0167] Illustratively, a mask attribute is true or false.
[0168] Step B3: for each of the contours, determine the key points in the key point set corresponding to the contour whose mask attribute is true as mask key points.
[0169] After extracting the key point sets of all contours, this application adds mask attributes to the key points, and only takes the key points with true mask attributes to participate in the subsequent ant colony algorithm, and the key points with false mask attributes do not participate in the ant colony calculation, so as to improve the efficiency of the ant colony algorithm.
[0170] Exemplarily, for contours with built-in leads, this application only marks the key point where the lead starts with a true mask attribute, and the mask attributes of other key points on the contour are false. For contours with more than 6 key points, this application will first calculate the distance from each key point in the contour to the next key point on the contour in the counterclockwise direction. The 6 key points with the shortest distance are selected and marked with a true mask attribute, and the mask attributes of other key points are false. The above operation can avoid the problem that contours with smaller areas but more complex shapes have a large number of key points, which reduces the operating efficiency of the ant colony algorithm.
[0171] For example, the number "6" is a hyperparameter, which is obtained based on experience. It is a balance between accuracy and computational efficiency. The more values are set, the higher the accuracy of the ant colony algorithm, but the efficiency decreases. Conversely, 6 is a balance choice.
[0172] In order for those skilled in the art to better understand the outline of the self-contained lead, the following example is given to illustrate: Figure 8 , which is a schematic diagram of an implementation method of the outline with self-contained leads provided in an embodiment of the present application.
[0173] Figure 8 The outline 81 with its own leads is shown, and the portion encircled by the dotted circle is the lead of the outline 81 with its own leads.
[0174] Lead is a definition in laser cutting, which is the lead-in and lead-out line of a part. Generally, in nesting software, users will manually set the position of leads for some parts, that is, determine the cutting start and end points of the parts. Some parts do not have leads, that is, the cutting start and end points of the parts are not determined.
[0175] In summary, during the cutting process, the cutting does not start from the contour, but from a small line segment outside the contour starting point, i.e., the lead. Therefore, for parts with leads, the cutting starting point of the part is determined, and no additional key points are needed to set the optional starting point of the part, so the masks of other key points will be set to false. For parts without leads, the cutting starting point is uncertain, and some key points are needed as alternatives for the cutting starting point. The ant colony algorithm selects which point among the key points as the cutting starting point.
[0176] Step S408: For each of the contour groups, obtain the eigenvector, distance matrix and cross matrix corresponding to the contour group.
[0177] The feature vector includes the number of each mask key point in the contour included in the contour group, the number of the contour to which each mask key point belongs, the number of the parent contour of the contour to which each mask key point belongs, the number of uncut sub-contours of the contour to which each mask key point belongs, and whether the contour to which each mask key point belongs has been cut; the distance matrix includes the distance between each pair of mask key points in all contours included in the contour group; the intersection matrix includes the number of intersections between the lines between each pair of mask key points in all contours included in the contour group and other contours in the contour group.
[0178] For each contour group G r After extracting the mask key points with true mask attributes from all contours in G, it is also necessary to perform mask extraction on each contour group G. r The mask key points contained are preprocessed: each contour group G is calculated r The eigenvector F ik r , distance matrix Q r and the cross matrix I r , for use in the subsequent ant colony algorithm.
[0179] Next, for the contour group G r The corresponding eigenvector F ik r , distance matrix Q r and the cross matrix I r Provide explanation.
[0180] Contour Group G r The corresponding eigenvector F ikr Includes contour group G r The feature vectors corresponding to each mask key point are included; exemplarily, the feature vector of each mask key point is a 5-dimensional vector, and the 5-dimensional elements represent the number of the mask key point, the number i of the contour to which the mask key point belongs, the number of the parent contour of the contour to which the mask key point belongs (exemplarily, if there is no parent contour, it is -1), the number of uncut sub-contours of the contour to which the mask key point belongs, and whether the contour to which the mask key point belongs has been cut (exemplarily, initially 0).
[0181] In the operation process of the ant colony algorithm, the feature vector F ik r The first three dimensions will be fixed, and the last two dimensions will be updated in real time.
[0182] Distance Matrix Q r It includes the distance between two mask key points, so that the ant colony algorithm can calculate the state transition probability of each city in the candidate city set based on the distance.
[0183] In order to make the ant colony algorithm meet the constraint of passing through the cut area as little as possible, this application also calculates the cross matrix I r , the cross matrix I r The number of intersections between the line between each two mask key points and each other contour is recorded. r is a In the ant colony algorithm, the candidate city set belongs to the set of adjacent contours of the contour to which the current mask key point of the ant belongs; the line between the current mask key point of the ant and the key point of the adjacent contour must not cross the non-adjacent contour, so this intersection matrix I r Most of the elements in are 0 or will not be used by the ant colony algorithm. Based on this, in order to save memory resources and improve efficiency, the cross matrix I r The design is in the form of a 4-dimensional sparse matrix. For example, the four dimensions represent: the number of the first mask key point, the number of the second mask key point, the number of contour AA, the number of intersections between the line between the first mask key point and the second mask key point and the contour AA; the intersection matrix is the sparse matrix I r The contour to which the first mask key point belongs must be the adjacent contour to which the second mask key point belongs, and contour AA must also be the adjacent contour to which the first mask key point or the second mask key point belongs.
[0184] Step S409: based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups, obtaining an efficient laser cutting tool path corresponding to the part contour image.
[0185] Exemplarily, the present application can utilize an improved ant colony algorithm to obtain an efficient laser cutting tool path corresponding to a part contour image.
[0186] The embodiment of the present application provides an efficient laser cutting tool path planning method, which includes obtaining a part contour image; obtaining multiple contours from the part contour image; obtaining contour nesting inclusion relationships corresponding to the multiple contours; obtaining multiple contour groups based on the contour nesting inclusion relationships corresponding to the multiple contours; obtaining adjacent contour candidate sets corresponding to the multiple contours; for each contour, dividing the target contour in the adjacent contour candidate set corresponding to the contour into an adjacent contour set; for each contour, obtaining key points with true mask attributes from the key points corresponding to the contour as mask key points; for each contour group, obtaining the eigenvector, distance matrix and cross matrix corresponding to the contour group; based on the eigenvector, distance matrix, cross matrix and adjacent contour set corresponding to the multiple contour groups, obtaining the efficient laser cutting tool path corresponding to the part contour image. Thus, the purpose of obtaining an efficient laser cutting tool path is achieved.
[0187] It is understandable that there are multiple ways to implement step S409. The embodiment of the present application provides but is not limited to the following method, which includes the following steps C11 to C21 during implementation.
[0188] This application can use the ant colony algorithm to sort the mask key points in each contour group Gr. Specifically, the mask key points are used as cities in the generalized traveling salesman problem. All the mask key points in the contour form a city cluster. Then the ant colony algorithm will find a shortest path so that this shortest path passes through all the city clusters and only passes through one city in each city cluster. This application takes into account the various special graphic processes (such as parts with sub-contours, parts with self-leads, and multi-layer nested parts) and some constraints (such as sub-contour priority cutting, adjacent parts priority cutting, direction priority cutting, small parts priority cutting, and common edge priority cutting) that may be contained in the parts composed of contours, as well as the situation where the shortest path passes through the cut area as little as possible. The following is an explanation.
[0189] Step C11: for each of the contours, determining that the mask key points contained in the contour constitute an urban cluster and determining that the mask key points are cities.
[0190] Step C12: Initialize the number of iterations, set the upper limit of the number of iterations, and initialize the path pheromone concentration of the paths between all cities included in the plurality of contour groups to 1.
[0191] For example, the number of initialization iterations N iter Set to 0, set the upper limit of the number of iterations to N max .
[0192] Step C13: Initialize the feature vectors corresponding to the plurality of contour groups respectively.
[0193] Step C14: For each of the contour groups, based on the ant colony algorithm, the characteristic vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set are used to obtain the target walking path corresponding to the contour group; the target walking path is the path from the set cutting starting point corresponding to the contour group to the set cutting end point corresponding to the contour group.
[0194] Exemplarily, step C14 includes the following steps D1 to D6.
[0195] Step D1: randomly placing a plurality of ants on any city on the city cluster closest to the set cutting starting point of the contour group.
[0196] For example, the number of ants is N ant .
[0197] Step D2: for each ant, update the taboo table of the ant and the feature vector of the city where the ant is located, wherein the taboo table includes a set of candidate cities that the ant has not visited, and the candidate city set includes one or more cities.
[0198] It is understandable that after the ant passes through a city, the contour representation of the city is cut; therefore, the feature vector F of the city where the ant is located is i kr The 5th dimension becomes 1, and the 4th dimension is reduced by 1.
[0199] Step D3: For each ant, if there is a candidate city set in the taboo table corresponding to the ant, calculate the state transition probability corresponding to each city included in the candidate city set; randomly select a target city from each city according to the state transition probability corresponding to each candidate city; if the taboo table corresponding to the ant is empty, query the distance matrix corresponding to the profile group for the target city that is closest to the city that the ant has not passed through. Determine that the target city is the next city that the ant will go to.
[0200] Step D4: Update the feature vector of the target city.
[0201] Step D5: Return to step D3 until all ants have passed through all the city clusters included in the contour group and reached the set cutting end point of the contour group.
[0202] Step D6: Determine the target walking path corresponding to the shortest displacement from the walking paths corresponding to the plurality of ants.
[0203] Step C15: Obtain the parent contours corresponding to the plurality of contour groups respectively.
[0204] Step C16: For each of the contour groups, obtain the key contour to which the previous second mask key point of the first mask key point contained in the parent contour in the target walking path corresponding to the contour group to which the parent contour of the contour group belongs; determine the second mask key point as the updated set starting point of the contour group; determine the first mask key point as the updated set cutting end point of the contour group; and obtain the updated set starting points and updated set cutting end points corresponding to multiple contour groups respectively.
[0205] Step C17: constructing the efficient laser cutting tool path based on the target walking paths respectively corresponding to the plurality of contour groups and the updated set starting points and updated set cutting end points respectively corresponding to the plurality of contour groups.
[0206] Exemplarily, the mask key point sorting results of all contour groups are connected to generate an efficient laser cutting tool path.
[0207] In order to obtain the empty line path of the entire contour set H, it is necessary to r The ant colony algorithm is used to find an optimal target walking path and merge them. Specifically, after the contours are grouped, each contour group G can be obtained. r The parent contour L r , remember the parent contour L r The previous contour (city group) that the contour group belongs to after being sorted by the ant colony algorithm is L r,last , and remember the parent contour L r and contour L r,last The city passed by is P r and P r,last This application will P r,last As the contour group G r After the update, set the cutting starting point to P r As the contour group G r After the update, set the cutting end point and set the upper contour group G r The target walking path is added to the parent contour L r The path P of the contour group to which it belongs r,last and P r In the middle, we get path P r,last →Contour Group G r The target walking path →P r After repeating the above operation for all contour groups, the complete empty line path of the contour set H can be obtained.
[0208] Step C18: Update the path pheromone concentrations of all paths between cities.
[0209] Step C19: Update the number of iterations.
[0210] Step C20: If the number of iterations does not reach the upper limit of the number of iterations, return to step C13.
[0211] Step C21: If the number of iterations reaches the upper limit number of iterations, the final high-efficiency laser cutting tool path is obtained.
[0212] The above-mentioned ant colony algorithm can basically solve the problem of efficient laser cutting tool path planning, but in the actual application of laser cutting, there are some special constraints on path selection, such as sub-contour priority cutting, adjacent parts priority cutting, direction priority cutting, small parts priority cutting, common edge priority cutting, and passing through the cut area as little as possible. Therefore, this application has made certain improvements to the construction of the taboo table, the calculation of state transition probability, and the calculation of the displacement of the walking path. In addition, in order to allow the ant colony method to be applied to large-scale parts collections of more than 500 parts, this application has also improved the pheromone update mechanism, such as the semi-elite ant pheromone update strategy, the maximum-minimum ant strategy, and added the nearest neighbor interpolation mutation algorithm and the function of automatically stopping after convergence. These improved functions will be introduced in detail below.
[0213] The method of "step D2 of updating the taboo table of the ant" is described below. The method includes the following steps E1 to E9 during implementation.
[0214] Step E1: Determine the city where the ant is currently located as the target mask key point.
[0215] Step E2: Detect whether the contour to which the target mask key point belongs has a parent contour to obtain a first detection result.
[0216] In order to achieve the four constraints of sub-contour priority cutting, adjacent parts priority cutting, common edge priority cutting, and minimizing the number of cut areas, this application has made some design on the construction of the taboo table. ik r , this application will first calculate the set of candidate city clusters that can be visited (i.e., steps E2 to E8), and then filter out the candidate city set from the set of candidate city clusters (step E9).
[0217] Step E3: If the first detection result is yes, query from the feature vector corresponding to the target mask key point whether there is an unpassed contour in the child contour of the parent contour that the ant has not passed; if so, divide the unpassed contour into a set of contours to be passed.
[0218] Step E4: Determine the intersection of the to-be-passed contour set and the adjacent contour set corresponding to the target mask key point as the candidate city cluster set.
[0219] Step E5: If the set of contours to be passed through is an empty set, the parent contours are divided into the set of candidate city clusters.
[0220] This application first determines the target mask key point P ik r Profile L i r Is there a parent contour? If so, it means that the contour L i r is a sub-contour. According to the sub-contour priority cutting constraint, it is determined whether there are contours that the ant has not passed through (hereinafter referred to as unpassed contours) in other sub-contours of the parent contour. For example, the query can be performed according to the fifth dimension of the feature vector of the mask key point. If there is an unpassed contour, according to the adjacent parts priority cutting constraint, the contours that belong to both the unpassed contour and the adjacent contour set M i r The contour set in is used as the candidate city cluster set. If there is no unpassed contour, the parent contour is directly used as the candidate city cluster set.
[0221] Step E6: If the first detection result is no, detect whether the contour to which the target mask key point belongs shares a common edge with other contours to obtain a second detection result.
[0222] Step E7: If the second detection result is yes, the contours that share common edges with the contours to which the target mask key points belong are divided into the candidate city cluster set.
[0223] Step E8: If the second detection result is no, determine the set of adjacent contours to which the target mask key point belongs as the set of candidate city clusters.
[0224] If the target mask keypoint P ik r Profile L i r If there is no parent contour, contour L will be judged i r Whether there are common edges with other contours. If there are common edges, according to the common edge priority cutting constraint, all contours that have common edges but have not been traversed by ants will be divided into the candidate city cluster set. i r If there is no common edge with other contours, then according to the priority cutting constraint of adjacent parts, the adjacent contour set M i r The outlines that have not been examined are divided into a set of candidate urban agglomerations.
[0225] Step E9: Based on the intersection matrix corresponding to the contour group to which the mask key point where the ant is located belongs, search for the target key point that has no intersection with the line connecting the target mask key point and the contour that the ant has passed from all the mask key points included in the candidate city cluster set; the taboo table includes the candidate city set consisting of the target key point.
[0226] After obtaining the candidate city cluster set of the target mask key point, it is also necessary to screen out the candidate city cluster set as the taboo table of the ant colony algorithm. According to the constraint of passing through the cut area as little as possible, find the mask key points P from all the mask key points in the candidate city cluster set that match the target mask key point P. ik r The mask key points between which the lines do not intersect with the contours that have been passed (can be obtained from the intersection matrix I r ), and used as the mask key point in the candidate city set.
[0227] The following is an explanation of the method for "calculating the state transition probabilities corresponding to each city included in the candidate city set in step D3" provided in the present application. The method includes the following steps during implementation:
[0228] For each city in the candidate city set, the state transition probability of the city is calculated by the following formula:
[0229] is the city where the ant is currently located; is the target key point, σ(·,·) represents the path pheromone concentration between the two cities, s(·,·) represents the difference in the X-axis coordinate values between the two cities, express The mean of the contour area and the bounding box area of the contour, α, β, γ, and δ represent the importance of the pheromone concentration of the path, the path The importance of , the importance of the ant's advancing direction, and the importance of the mean; Characterize the preset direction priority cutting constraint, Characterize preset small parts priority cutting constraints; path Characterized by arrive Path.
[0230] The factor can reflect the direction priority cutting constraint to a certain extent (prioritize cutting along the positive direction of the X axis). The factor can reflect the small parts priority cutting constraint to a certain extent.
[0231] Exemplarily, the preset direction priority cutting constraint and the preset small parts priority cutting constraint may be determined based on actual conditions, such as manually set.
[0232] The following is an explanation of the method provided in the present application of "determining the target walking path corresponding to the shortest displacement from the walking paths corresponding to the multiple ants in step D3". The method includes the following steps F1 to F2 during implementation.
[0233] Step F1: For each of the ants, The displacement of the ant's walking path is calculated; wherein, P S is the position of the cutting starting point, P e is the position of the cutting end point, N r is the number of the mask key points along the path of the ant from the set cutting starting point to the set cutting end point; d(·,·) is a function for calculating the distance between two mask key points; is the i-th mask key point passed by the ant;
[0234] Step F2: determining the target walking path corresponding to the shortest displacement from the displacements of the walking paths corresponding to the plurality of ants.
[0235] It can be understood that, assuming that the contour group G has been obtained r An ant in the cutting process starts from the set cutting starting point P. s To set the cutting end point P e The travel path is According to the above D r The formula can calculate the path distance of the path. The construction of the taboo table takes into account the constraint of passing through the cut area as little as possible. However, if the candidate city set of the taboo table of an ant is empty, the path between the next target city to which the ant goes and the city where the ant is currently located will inevitably pass through the cut area, violating the constraint of passing through the cut area as little as possible. Therefore, in order to further strengthen the constraint of passing through the cut area as little as possible on the basis of the taboo table, this application improves the calculation formula of the displacement of the walking path, that is, D r '.
[0236] w i The addition of can increase the penalty for the path passing through the cut area to a certain extent. Therefore, the above improved formula D r 'It is possible to further strengthen the constraint of passing through the cut area as little as possible.
[0237] In order to solve the problem of local convergence and slow convergence speed of the above improved ant colony algorithm in a large-scale parts collection of more than 500 parts, the present application improves the pheromone update mechanism of the ant colony algorithm. Specifically, the present application applies the semi-elite ant pheromone update strategy and the maximum-minimum ant strategy to make improvements.
[0238] The following is an explanation of the method for “updating the path pheromone concentrations of paths between all cities in step C18” provided in the present application. The method includes the following steps G1 to G2 during implementation.
[0239] The semi-elite ant pheromone update strategy is: for N in one iteration ant ants, only for displacement D r 'Minimum N ant / 2 The pheromone concentration on the path passed by ants is updated instead of updating all N ants in the original ant colony algorithm. ant The pheromone concentration on the path passed by each ant is updated to give more rewards to the ants that contribute the most, so that the ant colony algorithm can converge faster.
[0240] Step G1: From N ant Among the ants, the one with the smallest displacement on the walking path is obtained. Ants to be updated.
[0241] Step G2: For each path in the efficient laser cutting tool path By formula: Update the path Path pheromone concentration;
[0242] in, θ is the preset pheromone volatilization speed, D′ r,m To update the path After the path pheromone concentration is determined, the displacement of the walking path corresponding to the mth ant to be updated is, is any mask key point in the efficient laser cutting tool path, For the efficient laser cutting tool path The next mask key point of Characterized by arrive Path.
[0243] Exemplarily, the step of updating the path pheromone concentrations of paths between all cities also includes the following steps G3 to G5.
[0244] Steps G3 to G5 belong to the maximum-minimum ant strategy: In order to prevent the ant colony algorithm from easily falling into the local minimum and finding the global optimal solution, this application limits the range of the path pheromone concentration to [σ min , σ max ]. If the updated path pheromone concentration exceeds this range, it will be constrained within this range to prevent some paths from continuously accumulating pheromones and causing other potential better paths to have no chance to appear.
[0245] Step G3: If Belong to [σ min , σ max ],Sure For the path Path pheromone concentration.
[0246] Step G4: If Less than σ min , determine σ min For the path Path pheromone concentration.
[0247] Step G5: If Greater than σ max , determine σ max For the path Path pheromone concentration.
[0248] In order to further accelerate the convergence speed of the ant colony algorithm, this application proposes a nearest neighbor interpolation mutation algorithm to further modify the efficient laser cutting tool path with the shortest displacement in each iteration to see if a path shorter than the efficient laser cutting tool path can be found. The specific method includes the following steps H1 to H8.
[0249] Step H1: Determine the efficient laser cutting tool path as a set of paths to be mutated.
[0250] Assume that the efficient laser cutting tool path is
[0251] in, Set the cutting starting point for the processing plate area. Set the cutting end point for the processing plate area; P si r It refers to the i-th mask keypoint that the ant passes through. SR is the total number of all contours.
[0252] Step H2: Initialize the update times.
[0253] Exemplarily, the initialization update number is 0.
[0254] Step H3: Divide the to-be-mutated path set into a first sub-path set and a second sub-path set, and the time when the ants pass through the first sub-path set is earlier than the time when they pass through the second sub-path set.
[0255] Assume that the set of paths to be mutated is If SR is an even number, the first subpath set can be The second subpath set can be: If SR is an odd number, the first subpath set can be The second subpath set can be:
[0256] Step H4: Determine a third mask key point from the first sub-path set and determine a fourth mask key point from the second sub-path set so that the sum of the first distance and the second distance is minimized; the first distance is the distance between the third mask key point and the fourth mask key point; the second distance is the distance between the third mask key point and the next fifth mask key point of the third mask key point in the path set to be mutated.
[0257] Assume that the third mask keypoint determined from the first subpath set is P sp r , the fourth mask key point determined from the second subpath set is P sq r , assuming that the next mask key point of the fourth mask key point in the second subpath set is the fifth mask key point P sd r .
[0258] Step H5: inserting the third mask key point between the fourth mask key point and the fifth mask key point in the set of paths to be mutated, so as to obtain an updated set of paths to be mutated.
[0259] Step H6: If the number of updates does not reach The returning step divides the path set to be mutated into a first sub-path set and a second sub-path set.
[0260] Step H7: If the number of updates reaches The updated set of paths to be mutated is determined to be a target set of mutated paths.
[0261] Step H8: If the total displacement of the target variant path set is less than the total displacement of the efficient laser cutting tool path, update the efficient laser cutting tool path to the target variant path set.
[0262] In order not to waste the computing resources of the ant colony algorithm, after each iteration, the improved path distance D of the preset number of iterations before the current iteration is calculated.r 'Calculate the standard deviation. If the standard deviation is less than the threshold value of 20mm, it is considered that the ant colony algorithm has fully converged, and the algorithm iteration will be terminated early, which improves the computational efficiency of the ant colony algorithm.
[0263] The above introduces an efficient laser cutting tool path planning method for large-scale process parts provided by an embodiment of the present application. The following will introduce a device for executing the above-mentioned efficient laser cutting tool path planning method for large-scale process parts.
[0264] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a highly efficient laser cutting tool path planning device for large-scale process parts provided in an embodiment of the present application. Fig. 9 As shown, the efficient laser cutting tool path planning device for large-scale process parts includes:
[0265] A first acquisition module 901 is used to acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts;
[0266] A second acquisition module 902 is used to acquire multiple contours from the part contour image;
[0267] A third acquisition module 903 is used to acquire contour nesting inclusion relationships respectively corresponding to a plurality of contours, wherein the contour nesting inclusion relationship of the contour includes all parent contours and all child contours of the contour;
[0268] A fourth acquisition module 904 is used to acquire a plurality of contour groups based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, wherein the plurality of contours included in the contour group have the same parent contour;
[0269] A fifth acquisition module 905 is used to acquire adjacent contour candidate sets corresponding to the plurality of contours, wherein the adjacent contour candidate sets corresponding to the contour include a first preset number of contours in the contour group to which the contour belongs whose distances to the nearest points of the contour are the smallest;
[0270] A first division module 906 is used to divide, for each of the contours, a target contour in the adjacent contour candidate set corresponding to the contour into an adjacent contour set, wherein the target contour includes a sub-contour of the adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour;
[0271] A sixth acquisition module 907 is used to determine, for each contour, key points whose mask attributes are true among the key points corresponding to the contour as mask key points;
[0272] The seventh acquisition module 908 is used to acquire, for each of the contour groups, a feature vector, a distance matrix and a cross matrix corresponding to the contour group; the feature vector includes the number of each of the mask key points in the contours included in the contour group, the number of the contour to which each of the mask key points belongs, the number of the parent contour of the contour to which each of the mask key points belongs, the number of uncut sub-contours of the contour to which each of the mask key points belongs, and whether the contour to which each of the mask key points belongs has been cut; the distance matrix includes the distance between the mask key points in all contours included in the contour group; the cross matrix includes the number of intersections between the lines between the mask key points in all contours included in the contour group and other contours in the contour group;
[0273] The eighth acquisition module 909 is used to acquire the efficient laser cutting tool path corresponding to the part contour image based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups.
[0274] In an optional implementation, the eighth acquisition module includes:
[0275] A first determining unit is used to determine, for each of the contours, whether the mask key points included in the contour constitute an urban cluster and whether the mask key points are cities;
[0276] An initialization parameter unit, used to initialize the number of iterations, set an upper limit on the number of iterations, and initialize the path pheromone concentration of the paths between all cities included in the plurality of contour groups to 1;
[0277] An initialization feature unit, used to initialize the feature vectors respectively corresponding to the plurality of contour groups;
[0278] A first acquisition unit is used to acquire, for each of the contour groups, a target walking path corresponding to the contour group by using the feature vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set based on an ant colony algorithm; the target walking path is a path from a set cutting starting point corresponding to the contour group to a set cutting end point corresponding to the contour group;
[0279] A second acquisition unit is used to acquire parent contours corresponding to each of the plurality of contour groups;
[0280] The third acquisition unit is used to acquire, for each of the contour groups, a key contour to which a second mask key point immediately preceding a first mask key point contained in the parent contour in the target walking path corresponding to the contour group to which the parent contour of the contour group belongs; determine the second mask key point as the updated set starting point of the contour group; determine the first mask key point as the updated set cutting end point of the contour group; and obtain the updated set starting points and updated set cutting end points respectively corresponding to a plurality of the contour groups;
[0281] A construction unit, configured to construct the efficient laser cutting tool path based on the target walking paths respectively corresponding to the plurality of contour groups and the updated set starting points and the updated set cutting end points respectively corresponding to the plurality of contour groups;
[0282] A first updating unit, used for updating the path pheromone concentrations of paths between all cities;
[0283] A second updating unit, used for updating the number of iterations;
[0284] A trigger unit, configured to trigger the initialization feature unit if the number of iterations does not reach the upper limit number of iterations;
[0285] The fourth acquisition unit is used to acquire the final high-efficiency laser cutting tool path if the number of iterations reaches the upper limit number of iterations.
[0286] In an optional implementation, the first acquiring unit includes:
[0287] Setting a subunit for randomly placing a plurality of ants on any city on the city cluster closest to the set cutting starting point of the contour group;
[0288] A first updating subunit is used to update the taboo table of each ant, wherein the taboo table includes a set of candidate cities that the ant has not visited, and the set of candidate cities includes one or more cities;
[0289] The first processing subunit is used for, for each ant, if there is a candidate city set in the taboo table corresponding to the ant, calculating the state transition probability corresponding to each city included in the candidate city set; randomly selecting a target city from each city according to the state transition probability corresponding to each candidate city; if the taboo table corresponding to the ant is empty, querying the distance matrix corresponding to the profile group for a target city that is closest to the city that the ant has not passed through; and determining that the target city is the next city that the ant is heading to;
[0290] A second updating subunit, configured to update the feature vector of the target city;
[0291] A triggering subunit, used to trigger the first processing subunit until all ants have passed through all the city clusters included in the contour group and reached the set cutting end point of the contour group;
[0292] The determination subunit is used to determine the target walking path corresponding to the shortest displacement from the walking paths corresponding to the multiple ants.
[0293] In an optional implementation, the first updating subunit includes:
[0294] A first determination submodule is used to determine the city where the ant is currently located as a target mask key point;
[0295] A first detection submodule is used to detect whether the contour to which the target mask key point belongs has a parent contour, so as to obtain a first detection result;
[0296] A first processing submodule is configured to query, from the feature vector corresponding to the target mask key point, whether there is an unpassed contour that the ant has not passed through in the child contour of the parent contour if the first detection result is yes; if so, divide the unpassed contour into a set of contours to be passed;
[0297] A second determination submodule is used to determine the intersection of the to-be-passed contour set and the adjacent contour set corresponding to the target mask key point as the candidate city cluster set;
[0298] A first division submodule is used for dividing the parent contour into the candidate city cluster set if the set of contours to be passed through is an empty set;
[0299] A second detection submodule is used for detecting whether the contour to which the target mask key point belongs has a common edge with other contours if the first detection result is no, so as to obtain a second detection result;
[0300] A second division submodule is used for dividing the contours having common edges with the contours to which the target mask key points belong into the candidate city cluster set if the second detection result is yes;
[0301] A third determination submodule is configured to determine, if the second detection result is negative, the set of adjacent contours to which the target mask key point belongs as the set of candidate city clusters;
[0302] A search submodule is used to search for a target key point that has no intersection with a line connecting the target mask key point and a contour that the ant has passed through, from all the mask key points included in the candidate city cluster set, based on the intersection matrix corresponding to the contour group to which the mask key point where the ant is located belongs; the taboo table includes the candidate city set consisting of the target key point.
[0303] In an optional implementation, the first processing subunit is specifically configured to: for each city in the candidate city set, calculate the state transition probability of the city by the following formula:
[0304] is the city where the ant is currently located; is the target key point, σ(·,·) represents the path pheromone concentration between the two cities, s(·,·) represents the difference in the X-axis coordinate values between the two cities, express The mean of the contour area and the bounding box area of the contour, α, β, γ, and δ represent the importance of the pheromone concentration of the path, the path The importance of , the importance of the ant's advancing direction, and the importance of the mean; Characterize the preset direction priority cutting constraint, Characterize preset small parts priority cutting constraints; path Characterized by arrive Path.
[0305] In an optional implementation, the determining subunit includes:
[0306] The calculation submodule is used for calculating the formula The displacement of the ant's walking path is calculated; wherein, P S is the position of the cutting starting point, P e is the position of the cutting end point, N r is the number of the mask key points along the path of the ant from the set cutting starting point to the set cutting end point; d(·,·) is a function for calculating the distance between two mask key points; is the i-th mask key point passed by the ant;
[0307] The fourth determination submodule is used to determine the target walking path corresponding to the shortest displacement from the displacements of the walking paths corresponding to the plurality of ants.
[0308] In an optional implementation, the number of the plurality of ants is N ant , the first updating unit includes:
[0309] The first acquisition subunit is used to obtain ant Among the ants, the one with the smallest displacement on the walking path is obtained. Ants to be updated;
[0310] The third updating subunit is used for updating each path in the efficient laser cutting tool path. By formula: Update the path Path pheromone concentration;
[0311] in, θ is the preset pheromone volatilization speed, D′ r,m To update the path After the path pheromone concentration is determined, the displacement of the walking path corresponding to the mth ant to be updated is, is any mask key point in the efficient laser cutting tool path, For the efficient laser cutting tool path The next mask key point of Characterized by arrive Path.
[0312] In an optional implementation, the method further includes:
[0313] The first determining module is used if Belong to [σ min , σ max ],Sure For the path Path pheromone concentration;
[0314] The second determination module is used if Less than σ min , determine σ min For the path Path pheromone concentration;
[0315] The third determination module is used if Greater than Determine σ max For the path Path pheromone concentration.
[0316] In an optional implementation, the method further includes:
[0317] A fourth determination module is used to determine the efficient laser cutting tool path as a set of paths to be mutated;
[0318] The initial times module is used to initialize the update times;
[0319] A second division module is used to divide the to-be-mutated path set into a first sub-path set and a second sub-path set, wherein the time when the ants pass through the first sub-path set is earlier than the time when they pass through the second sub-path set;
[0320] a fifth determination module, configured to determine a third mask key point from the first subpath set and a fourth mask key point from the second subpath set, so that the sum of the first distance and the second distance is minimized; the first distance is the distance between the third mask key point and the fourth mask key point; the second distance is the distance between the third mask key point and the fifth mask key point next to the third mask key point in the path set to be mutated;
[0321] a ninth acquisition module, configured to insert the third mask key point between the fourth mask key point and the fifth mask key point in the set of paths to be mutated, so as to obtain an updated set of paths to be mutated;
[0322] Trigger module, used if the update times are not reached triggering the second division module;
[0323] The sixth determination module is used to determine if the number of updates reaches Determine the updated set of paths to be mutated as a target set of mutated paths;
[0324] An updating module is used to update the efficient laser cutting tool path to the target variation path set if the total displacement of the target variation path set is less than the total displacement of the efficient laser cutting tool path.
[0325] The present application also provides an electronic device in an embodiment. Fig.10 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.10 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0326] like Fig.10As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0327] Typically, the following devices may be connected to the I / O interface 1005: input devices 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a memory card, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0328] Also provided in an embodiment of the present application is a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the efficient laser cutting tool path planning methods provided in the embodiments of the present application.
[0329] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any one of the efficient laser cutting tool path planning methods provided in the embodiment of the present application.
[0330] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0331] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0332] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0333] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. An efficient laser cutting tool path planning method, characterized in that: include: Acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts respectively; Acquire a plurality of contours from the part contour image; Acquire a contour nesting inclusion relationship corresponding to a plurality of contours respectively, wherein the contour nesting inclusion relationship of the contour includes all parent contours and all child contours of the contour; Based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, a plurality of contour groups are obtained, wherein the plurality of contours included in the contour group have the same parent contour; Acquire adjacent contour candidate sets corresponding to the plurality of contours respectively, wherein the adjacent contour candidate set corresponding to the contour includes a first preset number of contours in the contour group to which the contour belongs and which have the shortest distance to the nearest point of the contour; For each of the contours, dividing a target contour in an adjacent contour candidate set corresponding to the contour into an adjacent contour set, wherein the target contour includes a sub-contour of the adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour; For each contour, determine the key points whose mask attributes are true among the key points corresponding to the contour as mask key points; For each of the contour groups, obtain the eigenvector, distance matrix and intersection matrix corresponding to the contour group; the eigenvector includes the number of each of the mask key points in the contours included in the contour group, the number of the contour to which each of the mask key points belongs, the number of the parent contour of the contour to which each of the mask key points belongs, the number of uncut sub-contours of the contour to which each of the mask key points belongs, and whether the contour to which each of the mask key points belongs has been cut; the distance matrix includes the distance between the mask key points in pairs in all the contours included in the contour group; the intersection matrix includes the number of intersections between the lines between the mask key points in pairs in all the contours included in the contour group and other contours in the contour group; Based on the characteristic vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups, an efficient laser cutting tool path corresponding to the part contour image is obtained.
2. The efficient laser cutting tool path planning method according to claim 1 is characterized in that: The step of obtaining an efficient laser cutting tool path corresponding to the part contour image based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups comprises: For each of the contours, determining that the mask key points contained in the contour constitute an urban cluster and determining that the mask key points are cities; Initializing the number of iterations, setting the upper limit of the number of iterations, and initializing the path pheromone concentration of the paths between all cities included in the plurality of contour groups to 1; Initializing the feature vectors respectively corresponding to a plurality of the contour groups; For each of the contour groups, the target walking path corresponding to the contour group is obtained based on the ant colony algorithm using the feature vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set; the target walking path is a path from the set cutting starting point corresponding to the contour group to the set cutting end point corresponding to the contour group; Obtain parent contours corresponding to each of the plurality of contour groups; For each of the contour groups, obtain the key contour to which the second mask key point preceding the first mask key point contained in the parent contour in the target walking path corresponding to the contour group to which the parent contour of the contour group belongs; determine the second mask key point as the updated set starting point of the contour group; determine the first mask key point as the updated set cutting end point of the contour group; and obtain the updated set starting points and updated set cutting end points respectively corresponding to the plurality of contour groups; Constructing the efficient laser cutting tool path based on the target walking paths respectively corresponding to the plurality of contour groups and the updated set starting points and the updated set cutting end points respectively corresponding to the plurality of contour groups; Update the path pheromone concentration of all paths between cities; updating the number of iterations; If the number of iterations does not reach the upper limit of the number of iterations, returning to the step of initializing the feature vectors corresponding to the plurality of contour groups respectively; If the number of iterations reaches the upper limit number of iterations, the final high-efficiency laser cutting tool path is obtained.
3. The efficient laser cutting tool path planning method according to claim 2 is characterized in that: The step of obtaining the target walking path corresponding to the contour group by using the feature vector corresponding to the contour group, the distance matrix, the intersection matrix and the adjacent contour set based on the ant colony algorithm includes: Randomly placing a plurality of ants on any city on the city cluster closest to the set cutting starting point of the contour group; For each ant, updating the taboo table of the ant, the taboo table including a set of candidate cities that the ant has not visited, the candidate city set including one or more cities; For each ant, if there is a candidate city set in the taboo table corresponding to the ant, calculate the state transition probabilities corresponding to each city included in the candidate city set; randomly select a target city from each city according to the state transition probabilities corresponding to each candidate city; if the taboo table corresponding to the ant is empty, query the distance matrix corresponding to the profile group for the target city that is closest to the city that the ant has not passed through; determine that the target city is the next city that the ant will go to; Updating the feature vector of the target city; Returning to the step of calculating the state transition probability corresponding to each city included in the candidate city set if there is a candidate city set in the taboo table corresponding to the ant, until all ants have passed through all the city clusters included in the contour group and reached the set cutting end point of the contour group; The target walking path corresponding to the shortest displacement is determined from the walking paths corresponding to the plurality of ants.
4. The efficient laser cutting tool path planning method according to claim 3 is characterized in that: The step of updating the taboo table of the ants comprises: Determine the city where the ant is currently located as the target mask key point; Detecting whether the contour to which the target mask key point belongs has a parent contour to obtain a first detection result; If the first detection result is yes, query from the feature vector corresponding to the target mask key point whether there is an unpassed contour that the ant has not passed in the child contour of the parent contour; if so, divide the unpassed contour into a set of contours to be passed; Determine the intersection of the to-be-passed contour set and the adjacent contour set corresponding to the target mask key point as the candidate city cluster set; If the set of contours to be passed through is an empty set, dividing the parent contour into the set of candidate city clusters; If the first detection result is no, detecting whether the contour to which the target mask key point belongs shares a common edge with other contours to obtain a second detection result; If the second detection result is yes, dividing the contours that share the same edge with the contour to which the target mask key point belongs into the candidate city cluster set; If the second detection result is no, determining the adjacent contour set of the contour to which the target mask key point belongs as the candidate city cluster set; Based on the intersection matrix corresponding to the contour group to which the mask key point where the ant is located belongs, a target key point that has no intersection with the line connecting the target mask key point and the contour that the ant has passed is searched from all the mask key points included in the candidate city cluster set; the taboo table includes the candidate city set composed of the target key points.
5. The efficient laser cutting tool path planning method according to claim 3 is characterized in that: The step of calculating the state transition probability corresponding to each city included in the candidate city set comprises: For each city in the candidate city set, the state transition probability of the city is calculated by the following formula: is the city where the ant is currently located; is the target key point, σ(·,·) represents the path pheromone concentration between the two cities, s(·,·) represents the difference in the X-axis coordinate values between the two cities, express The mean of the contour area and the bounding box area of the contour, α, β, γ, and δ represent the importance of the pheromone concentration of the path, the path The importance of , the importance of the ant's advancing direction, and the importance of the mean; Characterize the preset direction priority cutting constraint, Characterize preset small parts priority cutting constraints; path Characterized by arrive Path.
6. The efficient laser cutting tool path planning method according to claim 3 is characterized in that: The step of determining the target walking path corresponding to the shortest displacement from the walking paths corresponding to the plurality of ants comprises: For each of the ants, the formula The displacement of the ant's walking path is calculated; wherein, P S is the position of the cutting starting point, P e is the position of the cutting end point, N r is the number of the mask key points along the path of the ant from the set cutting starting point to the set cutting end point; d(·,·) is a function for calculating the distance between two mask key points; is the i-th mask key point passed by the ant; The target walking path corresponding to the shortest displacement is determined from the displacements of the walking paths corresponding to the plurality of ants.
7. The efficient laser cutting tool path planning method according to claim 2 is characterized in that: The number of the ants is N ant , the step of updating the path pheromone concentration of paths between all cities includes: From N ant Among the ants, the one with the smallest displacement on the walking path is obtained. Ants to be updated; For each path in the efficient laser cutting tool path By formula: Update the path Path pheromone concentration; in, θ is the preset pheromone volatilization speed, D′ r,m To update the path After the path pheromone concentration is determined, the displacement of the walking path corresponding to the mth ant to be updated is, is any mask key point in the efficient laser cutting tool path, For the efficient laser cutting tool path The next mask key point of the path Characterized by arrive Path.
8. The efficient laser cutting tool path planning method according to claim 7, characterized in that: The step of updating the path pheromone concentration of the paths between all cities also includes: like Belong to [σ min , σ max ],Sure For the path Path pheromone concentration; like Less than Determine σ min For the path Path pheromone concentration; like Greater than Determine σ max For the path Path pheromone concentration.
9. The efficient laser cutting tool path planning method according to claim 2, characterized in that: Before the step of updating the path pheromone concentrations of the paths between all cities, the method further includes: Determining the efficient laser cutting tool path as a set of paths to be mutated; Initialization update times; Dividing the path set to be mutated into a first sub-path set and a second sub-path set, wherein the time when the ants pass through the first sub-path set is earlier than the time when the ants pass through the second sub-path set; Determine a third mask key point from the first subpath set and determine a fourth mask key point from the second subpath set so that the sum of the first distance and the second distance is minimized; the first distance is the distance between the third mask key point and the fourth mask key point; the second distance is the distance between the third mask key point and the fifth mask key point next to the third mask key point in the path set to be mutated; Inserting the third mask key point between the fourth mask key point and the fifth mask key point in the set of paths to be mutated to obtain an updated set of paths to be mutated; If the number of updates does not reach Returning to the step of dividing the path set to be mutated into a first sub-path set and a second sub-path set; If the number of updates reaches Determine the updated set of paths to be mutated as a target set of mutated paths; If the total displacement of the target variant path set is less than the total displacement of the efficient laser cutting tool path, the efficient laser cutting tool path is updated to the target variant path set.
10. An efficient laser cutting tool path planning device, characterized in that: include: A first acquisition module is used to acquire a part contour image, wherein the part contour image includes contours corresponding to a plurality of parts; A second acquisition module, used for acquiring a plurality of contours from the part contour image; A third acquisition module is used to acquire a contour nesting inclusion relationship corresponding to a plurality of contours respectively, wherein the contour nesting inclusion relationship of the contour includes all parent contours and all child contours of the contour; A fourth acquisition module, configured to acquire a plurality of contour groups based on the contour nesting inclusion relationship respectively corresponding to the plurality of contours, wherein the plurality of contours included in the contour group have the same parent contour; A fifth acquisition module, configured to acquire adjacent contour candidate sets corresponding to the plurality of contours, wherein the adjacent contour candidate sets corresponding to the contour include a first preset number of contours in the contour group to which the contour belongs and which have the shortest distance to the nearest point of the contour; A first division module is used for dividing, for each of the contours, a target contour in an adjacent contour candidate set corresponding to the contour into an adjacent contour set, wherein the target contour includes a sub-contour of the adjacent contour and the adjacent contour, and a line connecting a certain point in the adjacent contour and a certain point of the contour does not intersect with other contours in the adjacent contour candidate set corresponding to the contour; A sixth acquisition module, for determining, for each contour, key points whose mask attributes are true among the key points corresponding to the contour as mask key points; A seventh acquisition module is used to acquire, for each contour group, a feature vector, a distance matrix and a cross matrix corresponding to the contour group; the feature vector includes the number of each mask key point in the contour included in the contour group, the number of the contour to which each mask key point belongs, the number of the parent contour of the contour to which each mask key point belongs, the number of uncut sub-contours of the contour to which each mask key point belongs, and whether the contour to which each mask key point belongs has been cut; the distance matrix includes the distance between the mask key points in all contours included in the contour group; the cross matrix includes the number of intersections between the lines between the mask key points in all contours included in the contour group and other contours in the contour group; An eighth acquisition module is used to acquire an efficient laser cutting tool path corresponding to the part contour image based on the feature vectors, the distance matrix, the intersection matrix and the adjacent contour set respectively corresponding to the plurality of contour groups.
Citation Information
Cited By
Assembly sequence planning method
CN120278473A