Circuit board wiring optimization method and device based on graph neural network

By combining deep reinforcement learning and local search algorithms, a circuit board wiring optimization method based on graph neural networks is constructed, which solves the problem of multi-objective optimization in circuit board wiring, improves the diversity and efficiency of understanding, and achieves more efficient circuit board wiring. optimization.

CN118839656APending Publication Date: 2024-10-25HUAQIAO UNIVERSITY
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410836482.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-25

AI Technical Summary

Technical Problem

When facing large-scale planning problems, simply using graph neural networks, reinforcement learning, and operational optimization technologies will lead to slow running speeds, low efficiency in processing high-dimensional problems, low solution accuracy, and problems that require a large number of expert strategies, especially on circuit boards. It is difficult to optimize effectively in wiring.

Method used

Combined with deep reinforcement learning technology and local search algorithm, by constructing a circuit board wiring optimization method based on graph neural network, the objective function and graph attention model are constructed, and the local search algorithm is used to optimize the initial solution set and generate the final Pareto front solution. set.

Benefits of technology

It improves the efficiency of obtaining diversified solutions in circuit board wiring, improves the advantages of the graph attention model in processing complex data relationships and graph structures, and provides a more effective solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118839656A_ABST
    Figure CN118839656A_ABST
Patent Text Reader

Abstract

The invention discloses a circuit board wiring optimization method based on a graph neural network. The method comprises the following steps: S101, constructing a target function according to multi-target features in a circuit wiring process; s102, constructing a graph attention model based on edge features; s103, generating and processing random data, training a graph attention model by using a loss function constructed according to the target function and the processed data, and generating a trained graph attention model; s104, collecting instance data, inputting the collected instance data into the trained graph attention model, and generating an initial Pareto frontier solution set external archive; and S105, optimizing the initial Pareto frontier solution set through a local search algorithm to obtain a final Pareto frontier solution set external file. According to the method, a single model of a graph attention model based on edge features is designed, and a solution of circuit board wiring can be obtained more efficiently; and a solution set generated by the graph attention model is further optimized through a local search algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the comprehensive field of graph neural network, reinforcement learning and operations optimization technology, and in particular to a circuit board wiring optimization method and device based on graph neural network. Background Art

[0002] With the continuous development of intelligent technology, especially artificial intelligence technology, various deep learning network models with superior performance have emerged in an endless stream, among which natural language processing technology for processing sequence problems is particularly prominent. Natural language processing technology has been widely verified and used in machine translation, information extraction and summarization, text classification and sentiment analysis, and speech recognition. Recently, this technology has gradually entered the field of vision of operations research researchers; operations optimization technology is a technology used to solve optimization problems, usually including dynamic programming, heuristic algorithms, exact algorithms, and emerging machine learning methods; reinforcement learning is an example of machine learning, which is based on the intelligent agent to achieve specific goals through trial and error, learning and adjusting behavior in a specific environment. In reinforcement learning, the intelligent agent continuously improves its behavior through interaction with the environment to maximize the expected cumulative reward. This learning method relies on the observation of the state of the environment, the actions taken, and the reward signals returned from the environment. Its goal is to develop an intelligent agent that can make optimal decisions without prior knowledge or explicit programming guidance. These three technologies have their own shining performance in their respective fields. However, when facing large-scale planning problems, simply using these three technologies is not enough, such as slow running speed, low efficiency in dealing with high-dimensional problems, low solution accuracy, and the need for a large number of expert strategies as theoretical support. Therefore, a new algorithm that can overcome these problems is needed.

[0003] Circuit Board Routing refers to the process of arranging the connections between electrical components in electronic devices through wires on printed circuit boards. This concept can be traced back to the 1950s, when the development of electronic devices gave rise to the demand for higher performance and more compact circuit boards. With the rapid development of the electronics industry, circuit board routing technology has been continuously innovated and improved. In recent years, with the miniaturization of electronic devices and the continuous improvement of demand functions, circuit board routing technology has also shown new development trends. For example, the development of high-density interconnect (HDI) technology has made it possible to achieve more connections in a limited space, which also provides the most basic technical possibility for the application of today's booming artificial intelligence technology to miniaturized electronic devices. In addition, the application of artificial intelligence technology also provides new ideas and possibilities for automatic routing, path planning, etc. Summary of the invention

[0004] In order to solve the above-mentioned problems, the present invention combines the advantages of deep reinforcement learning technology and local search algorithm, and proposes a circuit board wiring optimization method and device based on graph neural network.

[0005] On the one hand, the circuit board wiring optimization method based on graph neural network includes the following steps:

[0006] S101, constructing an objective function according to multi-objective features in the circuit wiring process;

[0007] S102, constructing a graph attention model based on edge features;

[0008] S103, generating random data and processing it, training the graph attention model using the loss function constructed according to the objective function and the processed data, and generating a trained graph attention model;

[0009] S104, collect instance data, input the collected instance data into the trained graph attention model, and generate an initial Pareto front solution set for external archiving;

[0010] S105, optimizing the initial Pareto front solution set by a local search algorithm to obtain the final Pareto front solution set for external archiving.

[0011] Preferably, in S101, constructing an objective function according to multi-objective features in the circuit wiring process specifically includes:

[0012] Construct the signal integrity optimization function and line length optimization function in the circuit board wiring, which can be expressed as:

[0013]

[0014] Among them, f1 is the signal integrity optimization function, which represents the sum of the signal integrity of each component in the circuit board wiring; f2 is the line length optimization function, which represents the total length of the line arranged from the starting component to the final component; i Indicates the signal integrity that should be retained when the signal starts from the power supply and reaches the i-th component in a complete wiring layout; Dis i It represents the wiring distance between the i-th component and the i-1-th component in a complete wiring layout; N represents the total number of components involved in a complete wiring layout;

[0015] After the circuit is laid out, the solution is: X = {x1, x2, ..., x N}, and the corresponding edge sequence is E = {e1,e2,...,e N-1}, and |e i |=dis i, and requires that each edge in E connects elements that have and are only visited once; based on this, the optimization goal is minF = {f1, f2}; according to the decomposition strategy and the characteristics of multiple objectives, the final objective function is expressed as:

[0016]

[0017] Where T represents the total number of objective functions, T = 2, i∈[1,2], λ i n Represents the i-th component of the n-th weight vector, n∈{1,2,...,Z}, where Z is the number of weight vectors.

[0018] Preferably, in S102, the constructed graph attention model based on edge features is a single model, and the construction process is specifically as follows:

[0019] Input a batch of training data of different targets and a batch of reference vectors;

[0020] After linear projection processing, the training data of different targets are merged with the processed reference vector to obtain the merging of different targets and different weight vector embeddings to obtain the embeddings of different targets;

[0021] The embeddings of different targets are further merged after linear projection operation and input into the multi-layer processing layer for multi-layer processing; the multi-layer processing layer includes a multi-head attention layer, an addition operation and batch normalization layer, and a forward propagation layer;

[0022] The final output graph embeds the data.

[0023] Preferably, in S103, generating random data and processing it, training the graph attention model using the loss function constructed according to the objective function and the processed data, and generating a trained graph attention model specifically includes:

[0024] S1031, generating data for training a model;

[0025] A set of random weight vectors λ = {λ 1 ,...,λ n ,...,λ Z}, and generate two random matrices Matrix corresponding to the weight vector object1 and Matrix object2 As training data;

[0026] S1032, preliminarily processing the training data;

[0027] The weight vector is processed to obtain the initial weight embedding information w 0, the distance between adjacent components and signal integrity constitute the edge information, and the edge information is processed to obtain the initial edge embedding information u 0 , w 0 and u 0 Concatenate into the initial embedded data h 0 ;

[0028] S1033, the encoder receives the generated initial embedded data h 0 After that, the embedded data is input into the multi-layer processing layer for information feature extraction and integration, where the processing of each layer is performed according to the following formula:

[0029]

[0030]

[0031] Where l∈{1,2,...,L}, L is the total number of processing layers, h l-1 is the intermediate embedded data obtained after processing of layer l-2, and It is the temporary intermediate data in the processing of the l-2 layers, MHA is the multi-head attention mechanism operation; BN represents the batch normalization function, ReLu represents the nonlinear function, W1 and W2 represent the trainable parameters; Represents a trainable matrix parameter used to integrate the embedding information obtained by multi-head attention;

[0032] After L layers of processing, the final embedding vector is obtained And h graph =h L As the final graph embedding data is obtained;

[0033] S1034, generate context embedding;

[0034] If the current moment is the beginning stage of circuit board wiring, the starting point is randomly selected, and then the initial context embedding Context is generated through the long short-term memory neural network LSTM 0 ; Otherwise, embed Context in combination with the context generated at the previous time t-1 t-1 and the current edge t-1 To select the next edge t , the formula for this process is as follows:

[0035]

[0036] in, is a partial solution of π 1:t-1 The edge embedding sequence set is empty at the initial stage, i.e., when t=1, d hrepresents the dimension of the last dimension of the embedding, d h =128,W1 m , W3 m , m∈{1,...M} is a trainable parameter, and M=8 is the number of multi-head attention layers; h ij represents the embedding from element i to element j, H t represents the embedding set of candidate edges at the current time t, softmax represents the activation function, represents the attention score of the multi-head attention layer m, represents the probability that the current solution of the multi-head attention layer m selects another candidate solution, e ij It represents the candidate edges available for selection at the current time t. Represents the processing matrix for multi-head attention m-layer information;

[0037] S1035, the decoder combines the graph to embed information h graph And context embedding Context t Calculate and select the next edge through decoding operation t Then, new edges are further selected according to the greedy strategy and random sampling strategy. The probability formula is as follows:

[0038]

[0039] in, is the current edge t-1 The attention score of its neighbor, S t is the state information of the model at the current time t, and The calculation formula is as follows:

[0040]

[0041] Among them, π t represents the solution at time t, C represents the hyperparameter; d represents a constant, and the value of d is d h / M, W3 represents the trainable matrix parameters; h next ∈h graph , represents the embedding of the next candidate edge;

[0042] S1036, determine whether a complete solution sequence is obtained, if a complete solution sequence is obtained, proceed to S1037, otherwise return to step S1034;

[0043] S1037, calculating the loss function value according to the loss function formula, and using the policy gradient to train the graph attention network model;

[0044] S1038 determines whether the model training is completed, that is, the number of training times reaches the set number of training times. If the training is not completed, return to step S1031, otherwise the training is terminated.

[0045] Preferably, the loss function value is calculated according to the loss function formula, and the strategy gradient is used to train the graph attention network model as follows:

[0046] The loss function constructed according to the objective function is L(θ). The loss function value is calculated according to the loss function formula. The parameter θ of the graph attention model is derived according to the obtained loss function value. The policy gradient is used to optimize the parameters of the graph attention model, which is expressed as:

[0047]

[0048] in, represents the result of the jth objective function when the graph attention model based on edge features uses a random selection strategy; b represents the mean of the solutions obtained when the graph attention model based on edge features uses a greedy strategy; B represents the number of training data in a batch used to train the model; represents the solution set obtained for the jth target in a batch of B training data; p θ Indicates that according to the current solution X and vector λ i n The value of the loss function required for the obtained training model; represents the derivative of θ.

[0049] Preferably, in S104, the instance data is actual data tested on a real circuit board and real data obtained from each component used.

[0050] Preferably, the S105 is specifically as follows:

[0051] S1051, let the acquired initial external archive be represented as EP, and let the temporary archive SP = EP and the intermediate temporary archive TP = EP;

[0052] S1052, initialize the reference line λ={λ1,λ2,...,λ Z},λ k ∈λ,λ k The calculation formula is: Where Z is the number of solutions in the initial external archive, which is equal to the number of weight vectors;

[0053] S1053, randomly selecting a solution series set X composed of multiple edges from the temporary archive SP, and generating a neighborhood solution set N(X) based on X by using a neighborhood search operation;

[0054] S1054, perform an environmental selection operation for each solution in the solution set N(X), that is, for X'∈N(X), if X'Pareto is better than the solution in the EP in the external archive, that is Y∈EP, then delete the dominated solution Y; if X' is dominated by a solution in the external archive, that is, When Y∈EP, delete the solution X'; finally update the external archive EP and SP=EP\TP;

[0055] S1055, determine whether the temporary archive SP is empty. And whether the number of current solutions X |EP| is less than the specified number N; if the condition is met, go to step S1056, otherwise return to step S1053;

[0056] S1056, insert new reference vector λ * , initialize the solution X corresponding to the reference line * , and update the external archive EP and λ, that is, EP = EP∪{X *},λ=λ∪{λ *}, and set SP = EP, which is expressed as follows:

[0057]

[0058] Among them, λ i is the solution currently being processed i The corresponding reference vector is the solution X, where ||...|| is the vector modulus symbol, X i represents the solution corresponding to the i-th reference vector or the i-th reference line;

[0059] S1057, determine whether the end condition of the entire algorithm is met, that is, the number of running rounds of the algorithm reaches the set number of rounds. If the end condition is met, the final external archive EP is output, otherwise return to step S1053.

[0060] On the other hand, a circuit board wiring optimization device based on a graph neural network includes:

[0061] An objective function building module, used to build an objective function according to multi-objective characteristics in the circuit wiring process;

[0062] Graph attention model building module, used to build a graph attention model based on edge features;

[0063] A graph attention model training module, used to generate and process random data, train the graph attention model using a loss function constructed according to the objective function and the processed data, and generate a trained graph attention model;

[0064] The initial solution set generation module is used to collect instance data, input the collected instance data into the trained graph attention model, and generate the initial Pareto frontier solution set for external archiving;

[0065] The local search algorithm optimization module is used to optimize the initial Pareto front solution set through the local search algorithm to obtain the final Pareto front solution set for external archiving.

[0066] Compared with the prior art, the present invention has the following beneficial effects:

[0067] (1) The traditional decomposition-based attention mechanism model decomposes the weight vector in advance and then trains it separately, while the attention model designed by the present invention is a single model that can directly obtain the initial solution through input data and weight vectors, thereby being able to more efficiently obtain diversified solutions in circuit board wiring;

[0068] (2) The present invention combines a local search algorithm to further improve the external archiving of the Pareto front solution set generated by the graph attention model, and better leverages the advantages of the graph attention network model in processing complex data relationships and graph structures, thereby providing a more effective solution for various practical application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a flowchart of a circuit board wiring optimization method based on a graph neural network according to an embodiment of the present invention;

[0070] Figure 2 A structural diagram of a model encoder of a circuit board wiring optimization method based on a graph neural network according to an embodiment of the present invention;

[0071] Figure 3 A schematic diagram of a multi-head attention mechanism of a circuit board wiring optimization method based on a graph neural network according to an embodiment of the present invention;

[0072] Figure 4 It is an algorithm flow chart of a circuit board wiring optimization method based on a graph neural network according to an embodiment of the present invention;

[0073] Figure 5 This is a structural block diagram of a circuit board wiring optimization device based on a graph neural network according to an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The present invention is further described below through specific implementation modes.

[0075] The ultimate goal of this invention is to construct a multi-objective combinatorial optimization algorithm framework that combines deep reinforcement learning and local search, which can quickly and efficiently obtain a diverse set of solutions.

[0076] See also Figure 1 and Figure 4 As shown, a circuit board wiring optimization method based on graph neural network includes the following steps.

[0077] S101, constructing an objective function according to the multi-objective features in the circuit wiring process. The specific implementation is as follows.

[0078] 1) In this embodiment, two conflicting objectives in the circuit board wiring problem are selected: signal integrity f1 and line length f2, and the objective functions corresponding to the two objectives can be expressed as:

[0079]

[0080] In the design of PCB wiring, it is usually hoped that the signal transmission path is shorter to reduce signal delay and loss. However, the requirement of shorter wiring path usually leads to an increase in wiring density, thereby increasing electromagnetic interference and wiring cost. Therefore, the signal integrity f1 is selected as the performance target of the circuit wiring scheme. At the same time, from the above description, it can be found that another important factor is the wiring length, so the wiring length f2 is selected as another optimization target. In the formula, f1 represents the sum of the signal integrity of each component in the PCB wiring; and f2 is the total length of the line arranged from the starting component to the final component. i Indicates the signal integrity that should be retained when the signal starts from the power supply and reaches the i-th component in a complete wiring layout; Dis i represents the wiring distance between the ith component and the i-1th component in a complete wiring layout; N represents the total number of components involved in a complete wiring layout; assuming that a solution obtained after arranging the route is: X = {x1, x2, ..., x N}, and the corresponding edge sequence is E = {e1,e2,...,e N-1}, and |e i |=dis i , and requires that each edge in E connects elements that have and only have been visited once. Based on this, the optimization goal of the multi-objective combinatorial optimization algorithm is minF = {f1, f2}. And according to the decomposition strategy and the characteristics of multiple objectives, the final objective function of the algorithm is defined as (where T = 2, i = 1, 2, then λ i n represents the ith component of the nth weight vector, n∈{1,2,...,Z}, Z is the number of weight vectors). Different weight vectors represent different preference tendencies, which means that the demand for different goals is diverse under different situations and different needs.

[0081] S102, construct a graph attention model based on edge features. The constructed graph attention model is a single model, such as Figure 2 As shown, the construction process is as follows:

[0082] Input a batch of training data of different targets and a batch of reference vectors;

[0083] After linear projection processing, the training data of different targets are merged with the processed reference vector to obtain the merging of different targets and different weight vector embeddings to obtain the embeddings of different targets;

[0084] The embeddings of different targets are further merged after linear projection operation and input into the multi-layer processing layer for multi-layer processing; the multi-layer processing layer includes a multi-head attention layer, an addition operation and batch normalization layer, and a forward propagation layer;

[0085] The final output graph embeds the data.

[0086] S103, generating random data and processing it, training the graph attention model using the loss function constructed according to the objective function and the processed data, and generating a trained graph attention model, the specific steps are as follows:

[0087] 2) Generate data for training the model, the data contains a set of random two-dimensional weight vectors λ = {λ 1 ,...,λ Z}, The same random adjacency matrix Matrix as the two batches object1 and Matrix object2 (For the target signal integrity, the element values ​​of the adjacency matrix represent random numbers of signal transmission strength, and these values ​​can simulate the signal transmission between different components; for the wiring length, the element values ​​in the adjacency matrix represent the distance between components), and then proceed to step 3);

[0088] 3) The input data is processed initially, and the weight vector is processed to obtain the initial weight embedding information w 0 ,,The distance between adjacent components and signal integrity constitute the edge information, and the edge information is processed to obtain the initial edge embedding information u 0 , and concatenated into the initial input embedding data h 0 =[u 0 ;w 0 ], go to step 4).

[0089] 4) The main model encoder of the network model is as follows Figure 2 As shown, the encoder accepts the initial embedded data h generated in the previous step 0After that, the embedded data is input into the multi-layer processing layer to extract and integrate the information features, where the processing of each layer is performed according to the following formula:

[0090]

[0091] Where l∈{1,2,...,L}, L is the total number of processing layers, h l-1 is the intermediate embedded data obtained after processing of layer l-2, and It is the temporary intermediate data in the processing of layer 1-2. After processing by layer L, the final embedding vector is obtained. And through the graph embedding information formula h graph =h L To obtain the final graph embedding data; MHA is a multi-head attention mechanism operation, which is also a very important technology in this embodiment. The specific details are shown in Figure 3 Among:

[0092] In the decoding part, in order to decode in the form of edges, unlike the traditional method of directly multiplying the embedding matrix (which may cause a large amount of confusion of information on other edges), it is necessary to perform a multi-head attention mechanism operation on the current edge embedding and the corresponding adjacent edge embedding. Figure 3 As shown, the embedding of the first vertical column corresponds to the embedding of the first row, so we take the embedding of the first column and pass it through W Q After linear transformation, it is embedded as the query Q, and the first row is passed through W K and W V After linear transformation, it is embedded as key K and value V.

[0093] Go to step 5);

[0094] 5) Generate context embedding. If the current moment is the beginning of the circuit board wiring, the starting point is randomly selected, and then the initial context embedding Context is generated through the long short-term memory neural network LSTM 0 ; Otherwise, embed the Context in combination with the context generated at the previous time t-1 t-1 and the current edge t-1 To select the next edge t , the formula of the process is as follows, and proceed to step 6)

[0095]

[0096] in is a partial solution of π 1:t-1 The edge embedding sequence set. In the initial stage, that is, when t = 1, this set is empty, and in this embodiment, dh represents the dimension of the last dimension of the embedding, d h =128,W1 m , W3 m ,m∈{1,2,...M} are all trainable parameters, and M=8 is the number of multi-head attention layers. ij represents the embedding from element i to element j, H t represents the embedding set of candidate edges at the current time t, softmax represents the activation function, represents the attention score of the multi-head attention layer m, represents the probability that the current solution of the multi-head attention layer m selects another candidate solution, e ij It represents the candidate edges available for selection at the current time t. Represents the processing matrix for the multi-head attention m-layer information, and proceeds to step 6);

[0097] 6) The decoder combines the graph embedding information h graph And the newly generated context is embedded in Context t Calculate and select the next edge through decoding operation t Next, according to different strategies (the chat strategy and random sampling strategy used in this embodiment), new edges are further selected. The probability formula is as follows, and then go to step 7)

[0098]

[0099] in is the current edge t-1 The attention score of its neighbor, S t is the state information of the model at the current time t, and The calculation formula is as follows:

[0100]

[0101] Among them, π t represents the solution at time t, C represents the hyperparameter; d represents a constant, and the value of d is d h / M=128 / 8=16, W3 represents the trainable matrix parameters; h next ∈h graph , represents the embedding of the next candidate edge;

[0102] 7) Determine whether a complete solution sequence is obtained (a complete solution sequence is represented in the circuit board wiring as all the components to be embedded in the circuit board are connected together through wiring, where each component is a solution in the solution sequence). If a complete solution sequence is obtained, proceed to step 8), otherwise return to step 5);

[0103] 8) Calculate the loss function value and use the policy gradient to train the graph attention network model. Go to step 9);

[0104] The loss function constructed according to the objective function is L(θ). The loss function value is calculated according to the loss function formula. The parameter θ of the graph attention model is derived according to the obtained loss function value. The policy gradient is used to optimize the parameters of the graph attention model, which is expressed as:

[0105]

[0106] in, represents the result of the jth objective function when the graph attention model based on edge features uses a random selection strategy; b represents the mean of the solutions obtained when the graph attention model based on edge features uses a greedy strategy; B represents the number of training data in a batch used to train the model; represents the solution set obtained for the jth target in a batch of B training data; p θ Indicates that according to the current solution X and vector λ i n The value of the loss function required for the obtained training model; represents the derivative of θ.

[0107] 9) Determine whether the model training is completed. If the model training is completed (in this embodiment, by determining whether the set number of training times is reached), proceed to step 10), otherwise return to step 2);

[0108] S104, collect instance data, input the collected instance data into the trained graph attention model, and generate an initial Pareto front solution set for external archiving, as follows:

[0109] 10) Input the test data (the actual data tested on the real circuit board and the real data obtained from each component used) into the trained model to obtain the initial external archive EP, and let the temporary archive SP = EP and the intermediate temporary archive TP = EP, and go to step 11);

[0110] S105, optimizing the initial Pareto front solution set through a local search algorithm to obtain the final Pareto front solution set for external archiving, as follows:

[0111] 11) Initialize the reference line λ = {λ1,λ2,...,λ Z}(Z is the number of solutions in the initial external archive),λ k The calculation formula is: Go to step 12);

[0112] 12) Randomly select a solution X from the temporary archive SP (the solution here is a solution sequence rather than an edge or point at a certain moment in the sequence, and is a sequence set composed of multiple edges), and based on this solution, use a neighborhood search operation (in this embodiment, three neighborhood operations 2-opt, 3-opt and or-opt) to generate a neighborhood solution set N(X), and go to step 13);

[0113] 13) Perform an environmental selection operation for each solution in the solution set N(X), that is, for X'∈N(X), if it is Pareto superior to the solution in the EP in the external archive Y∈EP, then delete the dominated solution Y; if it is dominated by a solution in the external archive When Y∈EP, delete the solution X'. Finally, update the external archive EP and SP=EP\TP, and go to step 14);

[0114] 14) Determine whether the temporary archive SP is empty, that is And whether the number of current solutions X |EP| is less than the specified number N. If the condition is met, then go to step 15), otherwise return to step 12);

[0115] 15) Insert new reference vector λ * , initialize the reference line λ * The corresponding solution X * , and update the external archive EP and λ, that is, EP = EP∪{X *},λ=λ∪{λ *} and set SP = EP, insert the reference line formula and the corresponding solution initialization as shown in the following formula, and go to step 16);

[0116]

[0117] where λ i is the reference vector corresponding to the solution currently being processed, i.e., the solution X selected in step 12), ||...|| is the vector modulus symbol, X i Represents the solution corresponding to the i-th reference vector or the i-th reference line.

[0118] 16) Determine whether the end condition of the entire algorithm is met, that is, the number of rounds of the algorithm reaches the set number of rounds. If the end condition is met, the final external archive EP is output, otherwise return to step 12).

[0119] See also Figure 5 As shown, the present invention also discloses a circuit board wiring optimization device based on a graph neural network, comprising:

[0120] An objective function construction module 501 is used to construct an objective function according to multi-objective features in a circuit wiring process;

[0121] A graph attention model building module 502, used to build a graph attention model based on edge features;

[0122] A graph attention model training module 503 is used to generate random data and process it, train the graph attention model using the loss function constructed according to the objective function and the processed data, and generate a trained graph attention model;

[0123] An initial solution set generation module 504 is used to collect instance data, input the collected instance data into the trained graph attention model, and generate an initial Pareto front solution set for external archiving;

[0124] The local search algorithm optimization module 505 is used to optimize the initial Pareto front solution set by using the local search algorithm to obtain the final Pareto front solution set for external archiving.

[0125] A specific implementation of a circuit board wiring optimization device based on a graph neural network and a circuit board wiring optimization method based on a graph neural network are not repeated in this embodiment.

[0126] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.

Claims

1. A circuit board wiring optimization method based on graph neural network, characterized in that: The following steps are involved: S101, constructing an objective function according to multi-objective features in the circuit wiring process; S102, constructing a graph attention model based on edge features; S103, generating random data and processing it, training the graph attention model using the loss function constructed according to the objective function and the processed data, and generating a trained graph attention model; S104, collect instance data, input the collected instance data into the trained graph attention model, and generate an initial Pareto front solution set for external archiving; S105, optimizing the initial Pareto front solution set by a local search algorithm to obtain the final Pareto front solution set for external archiving.

2. According to claim 1, the circuit board wiring optimization method based on graph neural network is characterized in that: In S101, constructing an objective function according to the multi-objective features in the circuit wiring process specifically includes: Construct the signal integrity optimization function and line length optimization function in the circuit board wiring, which can be expressed as: Among them, f1 is the signal integrity optimization function, which represents the sum of the signal integrity of each component in the circuit board wiring; f2 is the line length optimization function, which represents the total length of the line arranged from the starting component to the final component; i Indicates the signal integrity that should be retained when the signal starts from the power supply and reaches the i-th component in a complete wiring layout; Dis i It represents the wiring distance between the i-th component and the i-1-th component in a complete wiring layout; N represents the total number of components involved in a complete wiring layout; After the circuit is laid out, the solution is: X = {x1, x2, ..., x N }, and the corresponding edge sequence is E = {e1,e2,...,e N-1 }, and |e i |=dis i , and requires that each edge in E connects elements that have and are only visited once; based on this, the optimization goal is minF = {f1, f2}; according to the decomposition strategy and the characteristics of multiple objectives, the final objective function is expressed as: Where T represents the total number of objective functions, T = 2, i∈[1,2], Represents the i-th component of the n-th weight vector, n∈{1,2,...,Z}, where Z is the number of weight vectors.

3. The circuit board wiring optimization method based on graph neural network according to claim 2 is characterized in that: In S102, the graph attention model based on edge features is constructed as a single model, and the construction process is as follows: Input a batch of training data of different targets and a batch of reference vectors; After linear projection processing, the training data of different targets are merged with the processed reference vector to obtain the merging of different targets and different weight vector embeddings to obtain the embeddings of different targets; The embeddings of different targets are further merged after linear projection operation and input into the multi-layer processing layer for multi-layer processing; the multi-layer processing layer includes a multi-head attention layer, an addition operation and batch normalization layer, and a forward propagation layer; The final output graph embeds the data.

4. The circuit board wiring optimization method based on graph neural network according to claim 2 is characterized in that: In S103, the generating of random data and processing thereof, training the graph attention model using the loss function constructed according to the objective function and the processed data, and generating a trained graph attention model, specifically includes: S1031, generating data for training a model; A set of random weight vectors λ = {λ 1 ,...,λ n ,...,λ Z }, and generate two random matrices Matrix corresponding to the weight vector object1 and Matrix object2 As training data; S1032, preliminarily processing the training data; The weight vector is processed to obtain the initial weight embedding information w 0 , the distance between adjacent components and signal integrity constitute the edge information, and the edge information is processed to obtain the initial edge embedding information u 0 , w 0 and u 0 Concatenate into the initial embedded data h 0 ; S1033, the encoder receives the generated initial embedded data h 0 After that, the embedded data is input into the multi-layer processing layer for information feature extraction and integration, where the processing of each layer is performed according to the following formula: Where l∈{1,2,...,L}, L is the total number of processing layers, h l-1 is the intermediate embedded data obtained after processing of layer l-2, and It is the temporary intermediate data in the processing of the l-2 layers, MHA is the multi-head attention mechanism operation; BN represents the batch normalization function, ReLu represents the nonlinear function, W1 and W2 represent the trainable parameters; Represents a trainable matrix parameter used to integrate the embedding information obtained by multi-head attention; After L layers of processing, the final embedding vector is obtained And h graph =h L As the final graph embedding data is obtained; S1034, generate context embedding; If the current moment is the beginning stage of circuit board wiring, the starting point is randomly selected, and then the initial context embedding Context is generated through the long short-term memory neural network LSTM 0 ; Otherwise, embed Context in combination with the context generated at the previous time t-1 t-1 and the current edge t-1 To select the next edge t , the formula for this process is as follows: in, is a partial solution of π 1:t-1 The edge embedding sequence set is empty at the initial stage, i.e., when t=1, d h represents the dimension of the last dimension of the embedding, d h =128, is a trainable parameter, and M = 8 is the number of multi-head attention layers; h ij represents the embedding from element i to element j, H t represents the embedding set of candidate edges at the current time t, softmax represents the activation function, represents the attention score of the multi-head attention layer m, represents the probability that the current solution of the multi-head attention layer m selects another candidate solution, e ij It represents the candidate edges available for selection at the current time t. Represents the processing matrix for multi-head attention m-layer information; S1035, the decoder combines the graph to embed information h graph And context embedding Context t Calculate and select the next edge through decoding operation t Then, new edges are further selected according to the greedy strategy and random sampling strategy. The probability formula is as follows: in, is the current edge t-1 The attention score of its neighbor, S t is the state information of the model at the current time t, and The calculation formula is as follows: Among them, π t represents the solution at time t, C represents the hyperparameter; d represents a constant, and the value of d is d h / M, W3 represents the trainable matrix parameters; h next ∈h graph , represents the embedding of the next candidate edge; S1036, determine whether a complete solution sequence is obtained, if a complete solution sequence is obtained, proceed to S1037, otherwise return to step S1034; S1037, calculating the loss function value according to the loss function formula, and using the policy gradient to train the graph attention network model; S1038, determine whether the model training is completed, that is, the number of training times reaches the set number of training times. If the training is not completed, return to step S1031, otherwise the training is terminated.

5. The circuit board wiring optimization method based on graph neural network according to claim 4 is characterized in that: The loss function value is calculated according to the loss function formula, and the strategy gradient is used to train the graph attention network model as follows: The loss function constructed according to the objective function is L(θ). The loss function value is calculated according to the loss function formula. The parameter θ of the graph attention model is derived according to the obtained loss function value. The policy gradient is used to optimize the parameters of the graph attention model, which is expressed as: in, represents the result of the jth objective function when the graph attention model based on edge features uses a random selection strategy; b represents the mean of the solutions obtained when the graph attention model based on edge features uses a greedy strategy; B represents the number of training data in a batch used to train the model; represents the solution set obtained for the jth target in a batch of B training data; p θ Indicates that according to the current solution X and vector The value of the loss function required for the obtained training model; represents the derivative of θ.

6. The circuit board wiring optimization method based on graph neural network according to claim 1 is characterized in that: In S104, the instance data is actual data tested on a real circuit board and real data obtained from each component used.

7. The circuit board wiring optimization method based on graph neural network according to claim 1 is characterized in that: The S105 is specifically as follows: S1051, let the acquired initial external archive be represented as EP, and let the temporary archive SP = EP and the intermediate temporary archive TP = EP; S1052, initialize the reference line λ={λ1,λ2,...,λ Z },λ k ∈λ,λ k The calculation formula is: Where Z is the number of solutions in the initial external archive, which is equal to the number of weight vectors; S1053, randomly selecting a solution series set X composed of multiple edges from the temporary archive SP, and generating a neighborhood solution set N(X) based on X by using a neighborhood search operation; S1054, perform an environmental selection operation for each solution in the solution set N(X), that is, for X'∈N(X), if X'Pareto dominates the solution in the external archive EP, that is, X'<Y, Y∈EP, then delete the dominated solution Y; if X' is dominated by a solution in the external archive, that is, X'>Y, Y∈EP, then delete the solution X'; finally, update the external archive EP and SP=EP\TP; S1055, determine whether the temporary archive SP is empty. And whether the number of current solutions X |EP| is less than the specified number N; if the condition is met, go to step S1056, otherwise return to step S1053; S1056, insert new reference vector λ * , initialize the solution X corresponding to the reference line * , and update the external archive EP and λ, that is, EP = EP∪{X * },λ=λ∪{λ * }, and set SP = EP, which is expressed as follows: Among them, λ i is the solution currently being processed i The corresponding reference vector is the solution X, where ||...|| is the vector modulus symbol, X i represents the solution corresponding to the i-th reference vector or the i-th reference line; S1057, determine whether the end condition of the entire algorithm is met, that is, the number of running rounds of the algorithm reaches the set number of rounds. If the end condition is met, the final external archive EP is output, otherwise return to step S1053.

8. A circuit board wiring optimization device based on graph neural network, characterized in that: include: An objective function building module, used to build an objective function according to multi-objective characteristics in the circuit wiring process; Graph attention model building module, used to build a graph attention model based on edge features; A graph attention model training module, used to generate and process random data, train the graph attention model using a loss function constructed according to the objective function and the processed data, and generate a trained graph attention model; The initial solution set generation module is used to collect instance data, input the collected instance data into the trained graph attention model, and generate the initial Pareto frontier solution set for external archiving; The local search algorithm optimization module is used to optimize the initial Pareto front solution set through the local search algorithm to obtain the final Pareto front solution set for external archiving.

Citation Information

Cited By

  • Wiring process of multilayer printed circuit board

    CN119421325A

  • Precise mold design method and system based on intelligent optimization algorithm

    CN120654561A

  • Circuit board wiring optimization method

    CN120671628A

  • Method for optimizing circuit board wiring

    CN120671628B

  • Sensor-based integrated circuit arrangement optimization method and device

    CN120995972A