Strengthened pointer network-based coiled material rectangular piece layout method and device

Through a method based on reinforced pointer networks, combined with reinforcement learning and pointer networks, the problem of difficulty in balancing efficiency and accuracy in the layout of rectangular coiled parts is solved, and an efficient and accurate layout scheme is achieved, which significantly shortens the solution time and improves the accuracy of the layout. Material utilization.

CN118536649APending Publication Date: 2024-08-23山东浪潮智能生产技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410540972.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

There are efficiency and accuracy challenges in the layout problem of rectangular rolls. Traditional algorithms such as genetic algorithms, particle swarm algorithms and cuckoo search algorithms take a long time and are inefficient when dealing with large-scale and complex problems.

Method used

A method based on reinforced pointer networks is used, combined with reinforcement learning technology to train the pointer network. The A2C algorithm and pointer network are used to generate the sequence of rectangular parts, and the lowest horizontal line algorithm is used for positioning to quickly find the optimal layout plan.

Benefits of technology

It significantly shortens the solution time, improves the efficiency and accuracy of layout problems, reduces sheet waste, and improves coil utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536649A
    Figure CN118536649A
Patent Text Reader

Abstract

The invention discloses a rectangular coiled material piece layout method and device based on an enhanced pointer network, and belongs to the technical field of rectangular coiled material piece layout and deep learning, and the method comprises the steps: obtaining the width and height information of a rectangular piece to be subjected to layout; the width and height information of the to-be-arranged rectangular pieces is input into an actor network of a pre-trained reinforcement learning structure, an arrangement sequence of the to-be-arranged rectangular pieces is obtained, and the reinforcement learning structure adopts an A2C algorithm and takes a pointer network as a basic network; and according to the arrangement sequence, positioning the rectangular piece to be subjected to stock arrangement by adopting a lowest horizontal line algorithm. According to the method, the efficiency and precision challenges existing in the layout problem of the rectangular coiled material piece can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of coil rectangular piece arrangement and deep learning technology, and in particular to a coil rectangular piece arrangement method and device based on an enhanced pointer network. Background Art

[0002] The problem of nesting plays a pivotal role in many manufacturing fields. Whether it is the delicate operation of clothing cutting or the rigorous layout in plate cutting and furniture assembly, it is inseparable from the precise guidance of nesting technology. Especially in motor manufacturing, the manufacture of stator and rotor cores is a typical example of nesting application. In addition, the production of household floor tiles also requires the use of nesting technology to ensure that each floor tile can be cut out of the raw materials in the most optimized way. In the cost structure of manufacturing enterprises, the cost of raw materials often accounts for a considerable proportion. Therefore, through reasonable nesting layout, enterprises can not only reduce production costs and improve economic benefits, but also occupy a more advantageous position in the fierce market competition.

[0003] The problem of arranging rectangular parts of two-dimensional coils is an important branch of the field of arranging. It requires us to carefully arrange rectangular parts of various specifications in a plate of limited width to ensure that they do not overlap with each other and are completely within the limited range of the plate. However, from a computational point of view, this problem is quite complex. As the number of rectangular parts continues to increase, the time required for arranging will also increase exponentially, which brings us a considerable challenge to find an effective solution.

[0004] With the continuous innovation of computer hardware and software technology and the emergence of intelligent optimization algorithms, current research focuses on optimizing the order of rectangular parts (sequencing process) using intelligent optimization algorithms and determining the layout of rectangular parts on the plate according to certain emission rules (positioning process). Scholars have conducted in-depth exploration and innovation in these two directions.

[0005] In terms of positioning algorithms, the leftmost and bottommost algorithm refers to placing each rectangular piece as far to the lower left as possible according to the given rectangular piece arrangement order. The lowest horizontal line algorithm refers to searching all the highest contour lines to find the lowest horizontal line before arranging each rectangular piece, and flexibly adjusting the horizontal line position based on the comparison result between the width of the rectangular piece and the length of the lowest horizontal line, so as to make more effective use of the board space.

[0006] In terms of sequencing algorithms, genetic algorithms refer to finding the optimal layout scheme by simulating natural selection and genetic mechanisms. Through operations such as selection, crossover and mutation, the algorithm continuously iterates and optimizes the layout scheme, and finally finds a layout layout that meets the constraints and has the highest material utilization rate. Particle swarm algorithm refers to finding the optimal solution by simulating the foraging behavior of bird flocks. Each particle represents a possible layout scheme. The position and speed of the particle are updated according to the optimal solution of the individual and the group. By continuously updating the position and speed of the particles, the particle swarm gradually converges to the optimal layout scheme. Cuckoo search algorithm refers to adapting to layout problems of different scales and complexities by adjusting the search strategy and parameters, so as to find a layout scheme that meets the requirements.

[0007] Although sequencing algorithms such as genetic algorithm, particle swarm algorithm and cuckoo search algorithm play an important role in the sorting problem, they generally have the problems of long algorithm time and low efficiency. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a method and device for arranging rectangular parts of coiled materials based on an enhanced pointer network, so as to solve the efficiency and precision challenges existing in the problem of arranging rectangular parts of coiled materials.

[0009] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0010] In one aspect, the present invention provides a method for arranging rectangular coils based on an enhanced pointer network, comprising:

[0011] Get the width and height information of the rectangular pieces to be arranged;

[0012] Inputting the width and height information of the rectangular pieces to be arranged into the actor network of the pre-trained reinforcement learning structure to obtain the arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts the A2C algorithm and takes the pointer network as the basic network;

[0013] According to the arrangement sequence, the lowest horizontal line algorithm is used to locate the rectangular pieces to be arranged.

[0014] On the other hand, the present invention provides a coil rectangular piece arrangement device based on an enhanced pointer network, comprising:

[0015] An acquisition module is used to obtain the width and height information of the rectangular pieces to be arranged;

[0016] A sequencing module, used for inputting the width and height information of the rectangular pieces to be arranged into the actor network of the pre-trained reinforcement learning structure to obtain the arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts the A2C algorithm and is based on the pointer network as the basic network;

[0017] The positioning module is used to position the rectangular pieces to be arranged according to the arrangement sequence and adopt the lowest horizontal line algorithm.

[0018] On the other hand, the present invention provides an electronic device, comprising: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the above-mentioned method.

[0019] In yet another aspect, the present invention provides a computer-readable storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the above method.

[0020] The present invention has the following beneficial effects:

[0021] This paper innovatively proposes a reinforced pointer network to solve the packing problem. It uses reinforcement learning technology to train the pointer network, intelligently learns and adjusts the packing strategy, and can quickly find a better packing solution. Compared with traditional algorithms, the reinforced pointer network not only greatly shortens the solution time, but also shows higher efficiency and accuracy when dealing with complex packing problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic flow chart of the coil rectangular piece arrangement method based on the enhanced pointer network of the present invention;

[0023] Figure 2 This is a schematic diagram of the pointer network structure in the present invention;

[0024] Figure 3 It is a schematic diagram of the lowest horizontal line algorithm in the present invention;

[0025] Figure 4 It is a schematic diagram of the coil coordinate system in the present invention;

[0026] Figure 5 Schematic diagram of the convergence curve of the enhanced pointer network in the present invention, where (a) is the loss value of the actor network, (b) is the loss value of the critic network, and (c) is the average height of each batch of samples;

[0027] Figure 6 The layout effect diagram of the present invention on the public example Jakobs, where (a) corresponds to the public example J1, and (b) corresponds to the public example J2;

[0028] Figure 7The ideal layout effect diagram of the public example Jakobs, where (a) corresponds to the public example J1, and (b) corresponds to the public example J2;

[0029] Figure 8 It is a structural schematic diagram of the coil rectangular piece arrangement device based on the enhanced pointer network of the present invention;

[0030] Fig. 9 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0031] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0032] In order to solve the challenges of efficiency and accuracy in the layout of coiled rectangular parts, traditional layout methods, such as genetic algorithms, particle swarm algorithms, and cuckoo search algorithms, have certain effects in dealing with optimization problems, but they often have problems such as long algorithm time and low solution efficiency. Especially when dealing with large-scale and complex layout problems of coiled rectangular parts, the limitations of these traditional methods are more obvious.

[0033] As a new variant of sequence-to-sequence model, the reinforcement pointer network has the ability to directly output position pointers. It is particularly suitable for scenarios where the output sequence length is the same as the input sequence and each output element is a position pointer of the input sequence. By combining reinforcement learning technology, the reinforcement pointer network can learn how to better perform layout in the process of interacting with the environment, so as to quickly find a layout solution that meets the constraints and has high material utilization.

[0034] Therefore, the method for arranging rectangular parts of coiled materials based on an enhanced pointer network of the present invention aims to utilize the high efficiency and accuracy of the enhanced pointer network to improve the solution efficiency of the arrangement of rectangular parts of coiled materials, reduce the solution time, and at the same time ensure the quality of the arrangement plan and material utilization.

[0035] On the one hand, the present invention provides a method for packing rectangular coils based on a reinforcement pointer network, aiming to solve the challenge of balancing the efficiency and accuracy of packing rectangular coils, and provide an efficient and accurate solution for packing rectangular coils. This method combines the advantages of reinforcement learning and pointer networks, and achieves an accurate solution to the packing problem through adaptive learning and direct position output. Figure 1 As shown, the method includes:

[0036] Step S101: Obtaining the width and height information of the rectangular pieces to be arranged;

[0037] Step S102: inputting the width and height information of the rectangular pieces to be arranged into the actor network of the pre-trained reinforcement learning structure to obtain the arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts the A2C algorithm and takes the pointer network as the basic network;

[0038] In the present invention, a reinforced pointer network is used to sequence the rectangular pieces to be arranged, that is, the reinforcement learning structure adopts the A2C algorithm and the pointer network is used as the basic network, which is described in detail as follows:

[0039] A2C Algorithm

[0040] A2C (Advantage Actor Critic) and AC (Actor-Critic) are both algorithms in reinforcement learning. The main difference between them lies in the different functions used when the Actor network calculates the gradient.

[0041] In the AC algorithm, Actor (actor (network)) and Critic (critic (network)) are the two main components. The Actor is responsible for selecting actions based on the current state, and its goal is to learn a strategy to maximize the long-term cumulative reward. The goal of the Critic is to accurately predict future rewards to guide the Actor's decision. It evaluates the value of this action based on the reward and the new state, and provides feedback to the Actor.

[0042] The A2C algorithm uses the advantage function Q(s,a)-V(s) when calculating the gradient in the Actor network, where Q(s,a) is the state-action value function and V(s) is the state value function. The use of this advantage function helps the algorithm better identify which actions are better than other actions in a specific state.

[0043] In general, the main difference between A2C and AC is that the functions used by the Actor network to find gradients are different, which affects their performance in reinforcement learning tasks. Although the AC algorithm may not be as efficient as its variants (such as A2C) in some cases, it is still an important starting point for understanding and studying reinforcement learning. A2C combines the advantages of policy gradient and value function methods, and performs well in dealing with reinforcement learning problems in continuous action spaces and high-dimensional state spaces.

[0044] Pointer network construction

[0045] The pointer network PtrNet is a variant of the sequence-to-sequence model Seq2Seq. Based on the sequence-to-sequence model, the attention mechanism is modified. In the pointer network, the size of the output dictionary is equal to the length of the encoder input sequence. According to the value of the attention mechanism, one is selected from the encoder input as the decoder output. Figure 2 As shown, the pointer network realizes direct reference to the elements of the input sequence by introducing the pointer mechanism, so that it can handle the problem of variable output target size, which is particularly suitable for occasions that require sorting or processing of variable-length sequences.

[0046] In specific implementation, in the pointer network, the attention mechanism can first fuse the attention weight and the hidden state of the encoder at each time step as the context vector, and then merge the context vector and the hidden state of the decoder at the current time step as the output of the attention mechanism, where the pointer network directly uses the attention weight as the output probability of each position in the input sequence.

[0047] In the pointer network, the calculation formula for attention weight and output probability can be as follows:

[0048]

[0049]

[0050] in, is the attention weight, is the output probability of each position in the input sequence at time step i, Z i-1 is the hidden state of the decoder at time step i-1, h j is the hidden state of the encoder at time step j, W a and U a as a parameter.

[0051] Step S103: According to the arrangement sequence, the lowest horizontal line algorithm is used to locate the rectangular pieces to be arranged.

[0052] In this step, the lowest horizontal line algorithm is used for positioning, as detailed below:

[0053] Minimum horizontal line algorithm positioning

[0054] The core strategy of this algorithm is that after determining the order of the rectangular pieces, the rectangular pieces will be placed in the coil one by one. During the placement process, the algorithm will record all the horizontal lines formed by the highest contour line of the current coil. Then, among these horizontal lines, find the one that is the lowest and the leftmost. If the length of this lowest horizontal line is enough to accommodate the width of the rectangular piece to be placed, the algorithm will place the rectangular piece at the lowest left position of this lowest horizontal line.

[0055] However, if the lowest horizontal line is not long enough to accommodate the rectangular piece, the algorithm will make a strategic adjustment. It will raise the highest contour line at the lowest horizontal line until it finds an adjacent horizontal line that is lower but long enough. This process of raising and checking will be repeated until a suitable lowest horizontal line is found. Once found, the algorithm will place the rectangular piece at the bottom leftmost position of this horizontal line. Throughout the process, the algorithm will continue to update the highest contour line and the horizontal lines it forms, and repeat the above steps until all rectangular pieces are successfully placed in the coil according to the predetermined arrangement sequence.

[0056] like Figure 3 As shown, the lowest horizontal line positioning process of this algorithm is intuitively demonstrated. Suppose we have an arrangement sequence S = (1,2,3,4,...), which contains multiple rectangular pieces. When the algorithm arranges the first three rectangular pieces according to this sequence and is ready to arrange the fourth rectangular piece, it will first check the horizontal line L = (AB,CD,EF) formed by the currently recorded highest contour line. Among these horizontal lines, the algorithm will select the bottom and leftmost one. If the length of this line is not enough to accommodate the fourth rectangular piece, the algorithm will adjust the contour line until a suitable horizontal line is found. Once found, the fourth rectangular piece will be placed at the bottom and leftmost position of this line, and then the algorithm will continue to process the next rectangular piece in the sequence until all rectangular pieces are successfully arranged.

[0057] In this invention, in view of the two major challenges of using supervised learning to train a pointer network model, a reinforcement learning method is provided to train a pointer network model. This method shortens the training time of the network and improves the upper limit of the network model. The detailed description is as follows:

[0058] Reinforcement Learning Training

[0059] When using supervised learning to train pointer networks, we face two major challenges. If an exhaustive method is used to generate training samples, the time cost will become unbearable when the problem scale becomes large, which is obviously not an efficient method. If an iterative search algorithm is used to generate samples, although the time pressure can be alleviated to a certain extent, this method will bring a limitation to the pointer network: the output result of the network cannot exceed the optimal solution that can be achieved using the iterative search algorithm itself, which actually limits the performance upper limit of the pointer network. In addition, the encoder of the pointer network seems to have some dependence on the order of the input when processing the input. This feature that seems to be related to the input order may affect the generalization ability of the network, causing it to perform differently when processing inputs of different orders.

[0060] Reinforcement learning also focuses on studying how intelligent agents can take actions in the environment to maximize the cumulative rewards they receive. Because the coil rectangular parts layout problem has a simple reward mechanism, reinforcement learning can be used to train and guide the update of the pointer network, which can also solve the above problems.

[0061] Reinforcement Learning Structure

[0062] The actor-critic architecture A2C consists of two major components: the actor network and the critic network. The actor network mainly uses policy iteration, while the critic network relies on value iteration. The parameter adjustment of the actor network is based on the scores given by the critic network to its behavior, and its core goal is to improve these scores to obtain more ideal performance. The parameters of the critic network are optimized through rewards from environmental feedback, aiming to make its scores on the actor network's behavior closer and closer to the actual situation, thereby improving the accuracy of the score. In short, the actor network pursues better behavioral performance, while the critic network is committed to providing more accurate rating feedback.

[0063] The method for updating the critic network parameters is as follows:

[0064] (1) Calculate the objectives of the time difference method;

[0065] y t =r t +γq(s t+1 ,a t+1 ;w t )

[0066] (2) Calculate the loss function;

[0067]

[0068] (3) Update parameters.

[0069]

[0070] In the formula, q(s t ,a t ; w) is the critic network, w is the parameter of the critic network, s t is the state of step t, a t is the behavior of step t, r t is the reward for step t, γ is the discount factor, and α is the learning rate.

[0071] The method to update the actor network parameters is as follows:

[0072] (1) Calculate the cumulative reward;

[0073]

[0074] (2) Calculate the policy gradient;

[0075]

[0076] (3) Update parameters.

[0077] θ t+1 =θ t +βg(a,θ t )

[0078] Where π(a|s;θ) is the actor network, θ is the parameter of the actor network, and β is the learning rate.

[0079] That is to say, as an optional embodiment, the training of the actor network of the reinforcement learning structure adopts a strategy iteration method, and the training method may include:

[0080] The input of the actor network is the width and height information of each rectangular piece. First, the input is mirrored, that is, the input data is copied and the positions of the width and height are swapped to capture the potential relationship between different dimensions. Then the mirrored input data is converted into a word vector representation through the encoding layer for subsequent processing. The word vector is then input into the encoder to obtain a vector representation containing context information. The start vector (START vector) is then input into the decoder together with the context vector output by the encoder. The decoder generates the placement position of the first rectangular piece based on this information. Through the attention mechanism, the decoder can also dynamically adjust the degree of attention to the current input based on the previous output, thereby generating subsequent placement positions. This process is repeated until the placement sequence of all rectangular pieces is output. It is worth noting that in order to avoid generating repeated placement positions, an access state vector can be defined to record the positions that have been visited.

[0081] As another optional embodiment, the training of the critic network of the reinforcement learning structure adopts a value iteration method, and the training method may include:

[0082] The input of the critic network is the same as that of the actor network, and is also mirrored and transformed at the encoding layer; the critic network inputs the encoded word vector into the encoder to obtain the encoder output; then, the encoder output is processed through the attention mechanism and the fully connected network, and finally a score is output to measure the quality of the generated input sequence.

[0083] As another optional embodiment, the training method of the reinforcement learning structure may include:

[0084] In the training process of the reinforcement pointer network, the input is first obtained (specifically, n rectangular pieces can be generated as input by random sampling), the actor network generates an entry sequence based on these inputs, and the critic network scores the generated entry sequence; then, according to the entry sequence, the lowest horizontal line algorithm is used to locate the input (that is, the access order and the set of rectangular pieces are used as the input of the lowest horizontal line algorithm), and the actual reward value is calculated (specifically, it can be calculated through the utilization rate of the coil); according to the entry sequence, the score and the actual reward value, the parameters of the actor network and the critic network are updated respectively. Through continuous iterative training, the actor network and the critic network can gradually learn better arrangement strategies, thereby improving the utilization rate of the coil and reducing the waste of sheet materials.

[0085] In the present invention, the process before step S101 may include:

[0086] Step S100: Modeling of the layout problem.

[0087] The core of the coil rectangular packing problem is how to pack a set of n rectangular pieces P = [(w1,h1), (w2,h2), ..., (w n ,h n )] can be effectively arranged on a coil of fixed width W and unlimited height. Each of these rectangular pieces to be arranged has a specific width and height, and there are a large number of them. The arrangement process needs to follow strict processing conditions, that is, all rectangular pieces must be arranged parallel to the edge of the coil. At the same time, in order to ensure the quality of the arrangement, the rectangular pieces cannot overlap or exceed the boundaries of the coil.

[0088] In order to determine the position of each rectangular piece in the coil, it is first necessary to establish a coil coordinate system. Figure 4 As shown in the figure, the lower left corner of the plate is defined as the origin of the coordinate system, the lower side of the plate (width is W) is defined as the X axis of the coordinate system, and the left side of the plate (height is unlimited) is defined as the Y axis of the coordinate system. In the coil coordinate system, the placement position of each rectangular piece can be determined by the coordinate x of the lower left vertex of the rectangular piece. i and i to determine, and then by the width w of the rectangular piece i and height h i The position of any vertex of the rectangular piece can be obtained.

[0089] When solving the problem of coil rectangular parts layout, in order to accurately determine the position of each rectangular part on the coil, we first need to build a dedicated coil coordinate system. Figure 4As shown in the figure, the origin of the coil coordinate system is set at the lower left corner of the plate. This setting allows us to easily describe and calculate the position of the rectangular piece on the coil. We define the lower side of the plate, that is, its fixed width W, as the X-axis of the coordinate system. We define the left side of the plate, that is, its unlimited height, as the Y-axis of the coordinate system. In this coordinate system, the placement of each rectangular piece becomes clear and intuitive. We only need to determine the coordinates of the lower left vertex of the rectangular piece (x i ,y i ), we can know its exact position on the coil. Further, combined with the width w of the rectangular piece i and height h i , we can calculate the position of any vertex of the rectangular piece and then complete the construction of the entire layout plan.

[0090] The mathematical model of the coil rectangular parts layout problem is:

[0091] Objective function:

[0092]

[0093] Constraints:

[0094]

[0095] In the formula, f is the utilization rate, s is i is the area of ​​rectangular piece i, S is the layout area of ​​the coil, n is the number of rectangular pieces, W is the width of the coil, H is the layout height of the coil, w i ,h i are the width and height of rectangular piece i, respectively, (x i ,y i ) is the coordinate of the lower left corner of rectangular piece i.

[0096] In summary, the present invention aims to solve the problems of long solution time and low coil utilization rate of the existing coil rectangular piece sequencing algorithm, and provides a coil rectangular piece arrangement method based on an enhanced pointer network. This method significantly shortens the problem solution time and improves the coil utilization rate.

[0097] Public case test

[0098] The test running environment is as follows: the operating system is Ubuntu 20.04LST, the processor is AMD Ryzen 55600Hwith Radeon Graphics, the processor frequency is 3.30GHz, the memory is 16G, the graphics card is NVIDIA GeForceRTX 3050 Laptop GPU, the video memory is 4G, and the programming language is python3.9.

[0099] The parameters of the reinforced pointer network are set as follows: the number of training rounds is 2000, the number of samples in each batch is 256, the learning rate of the actor network is 0.0002, the learning rate of the critic network is 0.0002, the optimizer is Adam, the size of the word vector is 128, the encoder uses a long short-term memory network with 1 network layer and 128 hidden neurons, the decoder uses a long short-term memory network with 1 network layer and 128 hidden neurons, the Bahdanau attention mechanism parameter size is 128, the number of layers of the fully connected network is 2, the number of hidden neurons is 128, and the activation function is ReLU().

[0100] like Figure 5 As shown, the reinforced pointer network is trained using non-zero waste rate data, the actor network loss value converges to 7.921980, the critic network loss value converges to 0.453301, and the average height of each batch of samples converges to 34.57421875.

[0101] In the public example Jakobs verified the feasibility and versatility of the enhanced pointer network combined with the lowest horizontal line algorithm of the present invention. The enhanced pointer network layout effect diagram is shown in Figure 6 As shown, the utilization rate on the public example J1 is 75.00%, and the utilization rate on the public example J2 is 78.95%. The comparison results with the genetic algorithm in the prior art are shown in Table 1.

[0102] Table 1

[0103]

[0104] The Jakobs test of the public example shows that the present invention has the following advantages:

[0105] (1) The solution time is greatly shortened compared with existing methods;

[0106] (2) The utilization rate of the coiled material is improved compared with the existing method.

[0107] Description of the drawing

[0108] The public example Jakobs provided by the European Interest Group on Sampling Problems ESIUP (https: / / www.euro-online.org / websites / esicup / ) contains two data sets J1 and J2. The public example J1 is shown in Table 2, and the public example J2 is shown in Table 3.

[0109] Table 2 Public example J1

[0110]

[0111] Table 3 Public example J2

[0112]

[0113]

[0114] The ideal nesting effect of the public example Jakobs is as follows Figure 7 However, in actual operation, it is difficult to achieve this ideal layout, and this ideal layout is for reference only.

[0115] Aiming at the problems of low sample generation efficiency and performance bottleneck in the problem of coil rectangular parts layout, the present invention proposes a new training method and network structure design. By optimizing the sample generation strategy, the huge time consumption caused by the exhaustive method is avoided, and the limitation of the iterative search algorithm on the performance of the pointer network is overcome. In addition, by improving the encoder structure, the present invention reduces its dependence on the input order and improves the generalization ability of the network.

[0116] In the problem of packing rectangular parts of coiled materials, the present invention uses a pointer network to directly output the arrangement order of rectangular parts on the coiled materials, thereby realizing an accurate solution to the packing problem. Through the implementation of the present invention, the efficiency and accuracy of solving the packing problem can be significantly improved, the waste of sheet materials can be reduced, and the utilization rate of coiled materials can be improved. Therefore, the present invention provides an efficient and accurate solution to the problem of packing rectangular parts of coiled materials, and has broad application prospects and practical value.

[0117] On the other hand, the present invention provides a coil rectangular piece arrangement device based on an enhanced pointer network, such as Figure 8 As shown, including:

[0118] An acquisition module 11 is used to acquire width and height information of the rectangular pieces to be arranged;

[0119] A sequencing module 12 is used to input the width and height information of the rectangular pieces to be arranged into an actor network of a pre-trained reinforcement learning structure to obtain an arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts an A2C algorithm and is based on a pointer network as a basic network;

[0120] The positioning module 13 is used to position the rectangular pieces to be arranged according to the arrangement sequence by using the lowest horizontal line algorithm.

[0121] The device of this embodiment can be used to perform Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.

[0122] Preferably, in the pointer network, the attention mechanism first fuses the attention weight and the hidden state of the encoder at each time step as a context vector, and then merges the context vector and the hidden state of the decoder at the current time step as the output of the attention mechanism, wherein the pointer network directly uses the attention weight as the output probability of each position in the input sequence.

[0123] Preferably, in the pointer network, the calculation formulas for attention weight and output probability are as follows:

[0124]

[0125]

[0126] in, is the attention weight, is the output probability of each position in the input sequence at time step i, Z i-1 is the hidden state of the decoder at time step i-1, h j is the hidden state of the encoder at time step j, W a and U a as a parameter.

[0127] Preferably, the training of the actor network of the reinforcement learning structure adopts a strategy iteration method, and the training method includes:

[0128] Get the width and height information of each rectangular piece in the training set as input data;

[0129] Mirror the input data, i.e. copy the input data and swap the width and height to capture the potential relationship between different dimensions;

[0130] The input data after mirroring is converted into word vector representation through the encoding layer, and the word vector is input into the encoder to obtain a vector representation containing context information;

[0131] The starting vector and the context vector output by the encoder are input into the decoder together. The decoder generates the placement position of the first rectangular piece based on this information. Through the attention mechanism, the decoder can also dynamically adjust the degree of attention to the current input based on the previous output, thereby generating subsequent placement positions. This process is repeated until the placement sequence of all rectangular pieces is output.

[0132] Preferably, the training method of the actor network of the reinforcement learning structure further includes:

[0133] An access state vector is defined to record the locations that have been visited to avoid generating duplicate enqueue locations.

[0134] Preferably, the training of the critic network of the reinforcement learning structure adopts a value iteration method, and the training method includes:

[0135] The input of the critic network is the same as that of the actor network, and is also mirrored and transformed at the encoding layer; the critic network inputs the encoded word vector into the encoder to obtain the encoder output; then, the encoder output is processed through the attention mechanism and the fully connected network, and finally a score is output to measure the quality of the generated input sequence.

[0136] Preferably, the training method of the reinforcement learning structure includes:

[0137] The input is obtained, and the actor network generates a sorting sequence based on the input, and the critic network scores the generated sorting sequence; then, according to the sorting sequence, the lowest horizontal line algorithm is used to locate the input and calculate the actual reward value; according to the sorting sequence, the score and the actual reward value, the parameters of the actor network and the critic network are updated respectively. Through continuous iterative training, the actor network and the critic network can gradually learn better sorting strategies, thereby improving the utilization rate of the coil and reducing the waste of the plate.

[0138] The present invention also provides an electronic device, Fig. 9 The schematic diagram of the structure of the electronic device of the present invention can realize the present invention Figure 1 The process shown is as follows Fig. 9 As shown, the electronic device may include: a housing 41, a processor 42, a memory 43, a circuit board 44 and a power supply circuit 45, wherein the circuit board 44 is arranged inside the space enclosed by the housing 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to various circuits or devices of the electronic device; the memory 43 is used to store executable program codes; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 43, so as to execute the method described in any of the aforementioned method embodiments.

[0139] For details on the specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code, please refer to the present invention. Figure 1 The description of the illustrated embodiment will not be repeated here.

[0140] This electronic device exists in many forms, including but not limited to:

[0141] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.

[0142] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0143] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0144] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0145] (5) Other electronic devices with data interaction functions.

[0146] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any of the above method embodiments are implemented.

[0147] The present invention also provides an application program, which is executed to implement the method provided by any method embodiment of the present invention.

[0148] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0149] Each embodiment in this specification is described in a related manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. For the convenience of description, the description of the above device is divided into various units / modules according to their functions and described separately. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or one or more software and / or hardware.

[0150] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0151] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for arranging rectangular coils based on an enhanced pointer network, characterized in that: include: Get the width and height information of the rectangular pieces to be arranged; Inputting the width and height information of the rectangular pieces to be arranged into the actor network of the pre-trained reinforcement learning structure to obtain the arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts the A2C algorithm and takes the pointer network as the basic network; According to the arrangement sequence, the lowest horizontal line algorithm is used to locate the rectangular pieces to be arranged.

2. The method according to claim 1, characterized in that: In the pointer network, the attention mechanism first fuses the attention weight and the hidden state of the encoder at each time step as a context vector, and then merges the context vector and the hidden state of the decoder at the current time step as the output of the attention mechanism, where the pointer network directly uses the attention weight as the output probability of each position in the input sequence.

3. The method according to claim 2, characterized in that In the pointer network, the calculation formulas for attention weight and output probability are as follows: in, is the attention weight, is the output probability of each position in the input sequence at time step i, Z i-1 is the hidden state of the decoder at time step i-1, h j is the hidden state of the encoder at time step j, W a and U a as a parameter.

4. The method according to claim 1, characterized in that The training of the actor network of the reinforcement learning structure adopts a strategy iteration method, and the training method includes: Get the width and height information of each rectangular piece in the training set as input data; Mirror the input data, i.e. copy the input data and swap the width and height to capture the potential relationship between different dimensions; The input data after mirroring is converted into word vector representation through the encoding layer, and the word vector is input into the encoder to obtain a vector representation containing context information; The starting vector and the context vector output by the encoder are input into the decoder together. The decoder generates the placement position of the first rectangular piece based on this information. Through the attention mechanism, the decoder can also dynamically adjust the degree of attention to the current input based on the previous output, thereby generating subsequent placement positions. This process is repeated until the placement sequence of all rectangular pieces is output.

5. The method according to claim 4, characterized in that The training method of the actor network of the reinforcement learning structure also includes: An access state vector is defined to record the locations that have been visited to avoid generating duplicate enqueue locations.

6. The method according to claim 4, characterized in that The training of the critic network of the reinforcement learning structure adopts the value iteration method, and the training method includes: The input of the critic network is the same as that of the actor network, and is also mirrored and transformed at the encoding layer; the critic network inputs the encoded word vector into the encoder to obtain the encoder output; then, the encoder output is processed through the attention mechanism and the fully connected network, and finally a score is output to measure the quality of the generated input sequence.

7. The method according to any one of claims 1 to 6, characterized in that: The training method of the reinforcement learning structure comprises: The input is obtained, and the actor network generates a sorting sequence based on the input, and the critic network scores the generated sorting sequence; then, according to the sorting sequence, the lowest horizontal line algorithm is used to locate the input and calculate the actual reward value; according to the sorting sequence, the score and the actual reward value, the parameters of the actor network and the critic network are updated respectively. Through continuous iterative training, the actor network and the critic network can gradually learn better sorting strategies, thereby improving the utilization rate of the coil and reducing the waste of the plate.

8. A coil rectangular piece arrangement device based on an enhanced pointer network, characterized in that: include: An acquisition module is used to obtain the width and height information of the rectangular pieces to be arranged; A sequencing module, used for inputting the width and height information of the rectangular pieces to be arranged into the actor network of the pre-trained reinforcement learning structure to obtain the arrangement sequence of the rectangular pieces to be arranged, wherein the reinforcement learning structure adopts the A2C algorithm and is based on the pointer network as the basic network; The positioning module is used to position the rectangular pieces to be arranged according to the arrangement sequence and adopt the lowest horizontal line algorithm.

9. An electronic device, characterized in that: The electronic device comprises: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute any of the methods described in claims 1-7 above.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any of the methods described in claims 1-7.