A routing method and system based on CNN
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
- Filing Date
- 2025-05-16
- Publication Date
- 2026-08-07
AI Technical Summary
[0014]该场景下,最短的A-B-D-F路由反而需要多增加一个恢复中继,进而导致中继资源上的浪费
[0054]本实施例基于机器学习原理,实现了一种利用卷积神经网络模型的中继最少路由优化选择方案,能够通过训练集数据迭代自行训练获取拓扑中的抽象特征,以此获取在总体网络中使用中继总数最少的工作路径,彻底解决了传统KSP算法不能获得最少中继路径的问题。并且,本发明实施例的卷积神经网络在完成训练后拥有远超传统算法的精度和计算效率,且由于与拓扑本身的复杂度不相关,在极多节点、复杂度极高的网络中依然有优秀的处理速度,实际应用效果佳。
Smart Images

Figure CN120675920B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data and IP transmission equipment technology, specifically a routing method and system based on CNN (Convolutional Neural Networks). Background Technology
[0002] In current intelligent optical network systems, various planning and calculation functions for service routing exist to meet different service requirements. Among these, fault analysis is one of the most important functions. Its main purpose is to predict service failover processes, determine the network recovery status after a fault, and reserve network resources based on the recovered network data. In practical applications, fault analysis primarily involves removing unavailable resources and then using the K-Shortest Path algorithm (KSP) to calculate the shortest path for each service on the preprocessed network topology. The KSP algorithm is a routing algorithm that uses the concept of off-path to calculate the shortest path between two nodes in the topology. The routing calculation process used in conventional service expansion also uses the KSP algorithm to obtain the shortest path between nodes. In most cases, for routing scenarios between two points for a single service, KSP can obtain relatively good path results.
[0003] However, while KSP performs well in scenarios such as shortest paths, it does not perform well when the total route weight tends to be discrete. For example, in the relay priority algorithm, there are many service routes with the same number of newly added relays when calculating the relay priority. KSP cannot judge the superiority relationship between multiple routes of the same level and can only prioritize the route with the shorter total route length as the optimal route. This selection logic leads to unnecessary waste of resources. Therefore, in the manual fault stage, more resources have to be used for rerouting, which in turn leads to the use of too many newly added relays on the recovery route, resulting in a waste of relay resources.
[0004] For example: For Figure 1 The network topology shown assumes... Figure 1 All links in the network have equal OSNR (Optical Signal-to-Noise Ratio), and the OSNR will fall below a set threshold after every two links. There are currently no relays on the network. Therefore, the feasible path from node A to node F is:
[0005] 1) ABDF, hop count is 3, new relay number is 1, new relay is located at node D.
[0006] 2) ACGDF, hop count is 4, new relay count is 1, new relay is located at node G.
[0007] 3) ABEHF, hop count is 4, number of new intermediate nodes is 1, and the new relay is located at node E.
[0008] 4) ACGDBEHF, hop count is 7, number of new relays is 3, and the new relays are located at nodes G, B, and H.
[0009] Under the current routing logic, since 1) the hop count and length of the route are obviously lower than other routes, the optimal route from node A to node F will be ABDF. The KSP routing logic can determine the optimal route based on the link relationships and weights of the graph, but in the minimum relay scenario, the number of new relays for the first three routes is the same. In this scenario, the three routes are essentially equivalent and can all be regarded as the optimal route selection.
[0010] In scenarios where KSP results are used solely for unprotected service routing, they are often considered optimal. However, in fault analysis environments, for dynamic rerouting services, rerouting caused by different fault points can lead to the addition of extra relay nodes on the recovery route. The rerouting caused by faults in this scenario is as follows:
[0011] 1) Two reroutes are added: one to ACGDF when AB fails and another to ABEHF when DF fails. The number of newly added recovery relays is 2, and the new relays are located at nodes G and E.
[0012] 2) Rerouting to one route: If a fault occurs at any point on the original route, it will be rerouted to ABEHF. The number of newly added recovery relays is 1, and the newly added relay is located at node E.
[0013] 3) Rerouting to one line: If there is a failure at any point on the original route, it will be rerouted to ACGDF. The number of newly added recovery relays is 1, and the newly added relay is located at node G.
[0014] In this scenario, the shortest ABDF route actually requires an additional recovery relay, leading to a waste of relay resources. This is because KSP fails to incorporate node resources and connectivity elements into its computational model when processing routes. The ABDF route selects too many highly intersecting nodes, causing services to require two different pre-built routes to ensure recovery in the event of a link failure. Consequently, even when multiple equivalent routes exist, KSP chooses the route with the wasted recovery relay.
[0015] Furthermore, KSP does not consider the existing resource distribution in the network when processing routes, which may lead to excessive resource congestion on some routes, resulting in the loss of available recovery routes. This, in turn, forces other recovery routes to use routes that require more relays.
[0016] Therefore, how to provide a more optimized routing algorithm that can effectively and reasonably obtain the working path that uses the fewest relays in the overall network is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0017] The purpose of this invention is to provide a routing method and system based on CNN, which implements a route optimization scheme with the fewest relays using a convolutional neural network model. It can automatically train itself through training set data to obtain abstract features in the topology, thereby obtaining the working path with the fewest relays in the overall network.
[0018] To achieve the above objectives, in a first aspect, embodiments of the present invention provide a CNN-based routing method, the method comprising:
[0019] S1. Preprocess the topological structure data of the training set into data parameters that can be used by the convolution kernel to extract features;
[0020] S2. After the preprocessed data parameters are processed by convolution, pooling and fully connected layers, they are compared with the training expectation data and forward propagation is completed based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained.
[0021] S3. Preprocess the topological data that needs to be judged into data parameters that can be used by the convolution kernel to extract features;
[0022] S4. Input the preprocessed data parameters into the trained neural network for judgment, select the corresponding node using the judgment result of the neural network, and obtain the route with the fewest relays accordingly.
[0023] In conjunction with the first aspect, in one implementation, step S1 specifically includes: unfolding the nodes in the topology of the training set sequentially in the horizontal and vertical directions of the matrix, filling the intersection positions of the matrix with the OSNR values of the links directly connected to the two nodes, treating the OSNR values between nodes that cannot be directly connected as 0, and filling the parts that still cannot be filled to meet the convolution input size after tiling with 0.
[0024] In conjunction with the first aspect, in one implementation, step S2 specifically includes:
[0025] Input convolution kernel parameters for convolution processing, and use the convolution kernel to convert the preprocessed data parameters into a fixed-length matrix;
[0026] Max pooling is used to shrink the matrix size and extract the main features;
[0027] The obtained matrix is expanded into a one-dimensional matrix, and this one-dimensional matrix is used as a parameter to perform fully connected layer network calculations in the neuron structure.
[0028] Use activation functions to process the neuron outputs obtained from fully connected layer networks;
[0029] The output of the activation function is compared with the expected training data to construct a cost function. The gradients at all node positions in the entire matrix are obtained by taking the partial derivatives of the cost function in each direction.
[0030] Update the feature weights of the neuron structure based on the gradient parameter data;
[0031] Repeat the iteration until the neural network's overall judgment result converges, obtain the feature weights and bias values of the fully connected layers, and use these to obtain a trained neural network that has the ability to determine the path nodes with the fewest relays in the topology.
[0032] In conjunction with the first aspect, in one implementation, the logic for performing convolution processing is represented by the following formula:
[0033]
[0034] In the formula, y ij Q represents the parameter of the output fixed-length matrix at the coordinate position (i, j). uv The parameter x represents the convolution kernel at the coordinate position (u, v). u,v This represents the parameters of the input matrix at the coordinates (u, v), where U and V represent the length and width of the convolution kernel.
[0035] In conjunction with the first aspect, in one implementation, max pooling is used to shrink the matrix size and extract key features, specifically including:
[0036] Determine the filter size F and the step size S for moving the filter. Starting from the initial position, extract the maximum value of the parameters within the range [F, F] of the original matrix input to the pooling layer, and use this as the result at the corresponding position in the output matrix of the pooling layer. Then, move the filter S parameters along the positive direction of the matrix and repeat the above operation until the entire original matrix is extracted into a single matrix with a height of... Width The resulting matrix, where H1 and W1 are the height and width of the original matrix input to the pooling layer.
[0037] In conjunction with the first aspect, in one embodiment, the neuron structure can be represented by the following formula:
[0038]
[0039] In the formula, y represents the output of the neuron, and xi This represents the i-th result in the output of the previous layer, where n is the size of the input matrix, and w i θ represents the feature weight of the neuron for the i-th output, and θ represents the bias of the neuron.
[0040] In conjunction with the first aspect, in one implementation, the gradient is calculated using the following formula:
[0041]
[0042] In the formula, w j,k Let E represent the feature weight of the j-th parameter on the output neuron of node k, and let E represent the cost function currently used.
[0043] In conjunction with the first aspect, in one implementation, when updating the feature weights of the neuron structure based on gradient parameter data, the following update formula is used:
[0044] w′←w-αg
[0045] In the formula, w′ represents the updated feature weights, w represents the original feature weights, α represents the learning rate, and g represents the gradient.
[0046] In conjunction with the first aspect, in one implementation, when updating the feature weights of the neuron structure based on gradient parameter data, the following update formula is used:
[0047]
[0048] In the formula, w′ represents the updated feature weights, w represents the original feature weights, α represents the learning rate, t represents the round, and v t s represents the exponentially weighted average of the gradients over t rounds. t G represents the exponential moving average of the gradient over t rounds. t Let t be the gradient calculated in round t, and ε be the smoothing term.
[0049] Secondly, embodiments of the present invention also provide a CNN-based routing system for implementing the method in the first aspect embodiment, the system comprising:
[0050] The preprocessing unit is used to preprocess the topological data of the training set or the topological data that needs to be judged into data parameters that can be used by the convolutional kernel to extract features.
[0051] The training unit is used to compare the preprocessed training set data parameters with the training expectation data after the judgment processing of convolution, pooling and fully connected layers, and complete the forward propagation based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained.
[0052] The judgment and processing unit is used to input the preprocessed topology data parameters to be judged into the trained neural network for judgment, and select the corresponding node based on the judgment result of the neural network to obtain the route with the fewest relays.
[0053] The beneficial effects of the technical solutions provided in this application include:
[0054] This embodiment, based on machine learning principles, implements a relay-minimum route optimization scheme using a convolutional neural network model. It can iteratively train itself using training data to acquire abstract features of the topology, thereby obtaining the working path with the minimum number of relays in the overall network. This completely solves the problem that the traditional KSP algorithm cannot obtain the minimum relay path. Furthermore, the convolutional neural network of this embodiment, after training, possesses accuracy and computational efficiency far exceeding traditional algorithms. Because it is independent of the complexity of the topology itself, it still maintains excellent processing speed in networks with extremely many nodes and high complexity, resulting in excellent practical application performance. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the network topology for example;
[0056] Figure 2 This is a flowchart illustrating an embodiment of the CNN-based routing method of this application;
[0057] Figure 3 This is a schematic diagram of the preprocessed input matrix and the expected result;
[0058] Figure 4 This is a schematic diagram of the specific process of step S2 in the embodiments of this application;
[0059] Figure 5 This is a schematic diagram illustrating the process of performing two convolution and pooling operations.
[0060] Figure 6 This is a flowchart illustrating a CNN-based routing method in an example.
[0061] Figure 7 This is a schematic diagram of the functional modules of an embodiment of the CNN-based routing system of this application. Detailed Implementation
[0062] To make the technical problems, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] However, it should be noted that the examples described below are merely specific examples and are not intended to limit the embodiments of the present invention to the specific steps, values, conditions, data, order, etc. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0064] Example 1
[0065] See Figure 2 As shown, this embodiment provides a CNN-based routing method, which includes the following steps:
[0066] S1. Preprocess the topological structure data of the training set into data parameters that can be used by the convolution kernel to extract features;
[0067] S2. After the preprocessed data parameters are processed by convolution, pooling and fully connected layers, they are compared with the training expectation data and forward propagation is completed based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained.
[0068] S3. Preprocess the topological data that needs to be judged into data parameters that can be used by the convolution kernel to extract features;
[0069] S4. Input the preprocessed data parameters into the trained neural network for judgment, select the corresponding node using the judgment result of the neural network, and obtain the route with the fewest relays accordingly.
[0070] Understandably, in this embodiment, before training the convolutional neural network using the training set, the topological data of the training set is preprocessed to transform it into a data format that can be used to extract features using convolutional kernels. Specifically, in order to achieve the training objective of obtaining a neural network capable of identifying the path nodes with the fewest relays in the topology, this preprocessing process needs to convert the topology into matrix form while preserving its connectivity and link OSNR values.
[0071] For example, as an optional implementation, in step S1 of this embodiment, the topological structure data of the training set is preprocessed into data parameters that can be used by the convolutional kernel to extract features, including:
[0072] The nodes in the training set's topology are sequentially unfolded along the horizontal and vertical axes of the matrix. Intersections are filled with the OSNR values of directly connected links between nodes; OSNR values between nodes that are not directly connected are considered 0. Any remaining gaps after unfolding that do not meet the convolution input size are filled with 0s. In practical applications, node information in the training set's topology can be obtained by acquiring the node association table of the training set's topology. Furthermore, in this embodiment, the convolution input size can be designed to use a 200×200×1 matrix as the convolution input matrix.
[0073] Additionally, it's understandable that the training set data needs to have corresponding expected training results. In the result mapping, all nodes along the routing path will be set to 1, indicating they are selected by the neural network; nodes not along the path will be set to 0, indicating they are not selected by the network. The training set data used for training should ensure coverage of topologies of different sizes and that the expected results are accurate. The training set should use more than 4000 data points; the more training data, the better the neural network's training effect, and the more accurate the judgment results will be. Here, we take... Figure 1 Taking the topology shown as an example, assume Figure 1 If the OSNR of all links in the array is 20, then the preprocessed input matrix and the expected result are as follows: Figure 3 As shown. Figure 3 In the process, the preprocessed input matrix is a 200×200×1 matrix (the input matrix is a single channel, i.e., thickness is 1). During preprocessing, Figure 1 The nodes in the topology shown are sequentially expanded along the horizontal and vertical directions of the matrix. The intersection of the matrix is filled with the OSNR value of 20 for the direct connection between two nodes, and the OSNR value between nodes that cannot be directly connected is filled with 0. The rest of the matrix is filled with 0. Figure 3 In the expected result Res, the nodes with the fewest relay routes selected by the network are A, C, D, F, and G.
[0074] The formula for calculating the OSNR value is as follows:
[0075]
[0076] In formula (1), op i M represents the input optical power of the i-th OA (Optical Amplifier). i Let nf be the background channel number of the link containing the i-th OA. i Let be the noise figure of the i-th OA, and N be the total number of OAs on a link.
[0077] Further, see Figure 4 As shown, as an optional implementation, step S2 of this embodiment specifically includes:
[0078] S201. Input convolution kernel parameters and perform convolution processing. The convolution kernel converts the preprocessed data parameters (i.e., two-dimensional topological data, such as...) into... Figure 3 The input matrix shown is converted into a fixed-length matrix.
[0079] In this embodiment, the logic for performing convolution processing can be represented by the following formula:
[0080]
[0081] In equation (2), y ij Q represents the parameter of the output fixed-length matrix (i.e., the convolutional layer result matrix) at the coordinate position (i, j). uv The parameter x represents the convolution kernel at the coordinate position (u, v). u,v The parameter represents the input matrix (i.e., the original matrix input to the convolutional layer) at the coordinate position (u, v), where U and V represent the length and width of the convolutional kernel.
[0082] It is understandable that, macroscopically speaking, the vast majority of nodes in the topology are disconnected, resulting in a sparse input matrix in most cases. Therefore, choosing an excessively large kernel or stride can lead to the omission of necessary information. For example, in a specific application, a 200×200×1 matrix can be used as the preprocessed input matrix. Correspondingly, for the kernel parameters, 16 kernels of size 5×5×1 and a stride of 3 can be used for convolution. After completing one convolution according to the above logic, a fixed-length matrix of size 66×66×16 is obtained. This matrix is an intermediate state matrix, awaiting further processing.
[0083] S202. Use max pooling to shrink the matrix size and extract the main features.
[0084] It is understandable that pooling is mainly used to shrink data to reduce computation. In this embodiment, max pooling is used to shrink the matrix size and extract key features, specifically including:
[0085] Determine the filter size F and the step size S for moving the filter. Starting from the initial position, extract the maximum value of the parameters within the range [F, F] of the original matrix input to the pooling layer, and use this as the result at the corresponding position in the output matrix of the pooling layer. Then, move the filter S parameters along the positive direction of the matrix and repeat the above operation until the entire original matrix is extracted into a single matrix with a height of... Width The resulting matrix, where H1 and W1 are the height and width of the original matrix input to the pooling layer.
[0086] For example, in a specific application, the pooling layer filter size F = 2 and the step size S = 2 can be determined. Using this filter for max pooling, the fixed-length matrix of size 66×66×16 obtained after one convolution can be extracted into a matrix of size 33×33×16. This matrix is used as the output matrix of the pooling layer, thus achieving the purpose of shrinking the data to reduce the amount of computation.
[0087] Furthermore, in order to further extract abstract features and reduce subsequent computational burden, as an optional implementation method, in practical applications, after performing one convolution and pooling process, the convolution and pooling process can be repeated again (repeatedly executing steps S201 and S202), that is, a total of two convolution and pooling processes can be performed.
[0088] For example, in a specific application, the second convolution process can use 12 3×3×16 convolution kernels with a stride of 2; then, a filter of size 2 is used with a stride of 2 to perform the second max pooling process, resulting in an 8×8×12 matrix. In subsequent step S203, this matrix can be horizontally unfolded to obtain a 1×1×768 one-dimensional matrix, which is used as the input to the fully connected layer. The process of performing two convolution and pooling processes in the above manner can be found in [reference needed]. Figure 5 As shown.
[0089] S203. Expand the obtained matrix into a one-dimensional matrix, and use this matrix as a parameter to perform fully connected layer network calculations in the neuron structure.
[0090] It is understandable that after the matrix obtained through convolution and pooling is unfolded into a one-dimensional matrix, this one-dimensional matrix can be used as the input parameter of the fully connected layer and inserted into the neuron structure for fully connected layer network computation.
[0091] In this embodiment, the neuron structure can be represented by the following formula:
[0092]
[0093] In equation (3), y represents the output of the neuron, which will be used as a feature of the next layer in the next round of calculation after passing through the activation function; x i This represents the i-th result in the previous layer's output; n is the size of the input matrix; w i θ represents the feature weight of the neuron for the i-th output; θ represents the bias of the neuron.
[0094] Additionally, it is understandable that feature weights and biases need to be randomly initialized to ensure training effectiveness. In this embodiment, since ReLU is subsequently used as the activation function, the random value selection follows the Kaiming initialization approach, taking initial values from the following range:
[0095]
[0096] Where n is the size of the input matrix. The feature weights and biases are randomly selected from the range D as their initial values.
[0097] S204. Use activation functions to process the neuron outputs obtained from the fully connected layer network.
[0098] Understandably, convolutional neural networks typically produce only a single result. When the result is passed through the softmax layer, it is mapped to a finite number of classification results, ensuring that their sum is 1. However, the result desired in this scheme cannot be described by classification logic, so an activation function is needed to control the convergence effect of the result.
[0099] In this embodiment, ReLU is used as the activation function, and its structure can be described by the following formula:
[0100]
[0101] In equation (5), λ is a constant that is adjusted according to the actual parameter size of the neural network. In this embodiment, λ is set to 1 in the network structure.
[0102] After processing the neuron outputs obtained from the fully connected layer network using the above activation function, the formula for the neuron structure of each layer is modified as follows:
[0103]
[0104] Furthermore, to avoid the overfitting problem that often occurs in neural networks, as an optional implementation method, a DropOut process can be applied after each layer of neurons has completed its computation. The processing logic is as follows: neurons in the previous layer are randomly selected with a certain coefficient and removed, so that their output parameters do not participate in the computation and iteration of the next stage of neurons. This solves the problem that some noisy data can cause a decrease in the neural network's judgment ability. For example, in the neural network of this embodiment, a DropOut coefficient of 0.7 can be selected, meaning that 70% of the neurons are discarded in this process.
[0105] Furthermore, it is understood that the fully connected layer contains multiple layers of neurons. For example, in a specific application, the fully connected layer network structure used in this embodiment can be 768×600×600×200, meaning the fully connected layer has four layers: the first layer has 768 neurons, the second layer has 600, the third layer has 600, and the fourth layer has 200. Moreover, the operations described in steps S203 and S204 above need to be performed on each layer of neurons, and the weights and biases of each layer need to be initialized manually. Similarly, subsequent forward propagation requires updating the neurons in each layer layer by layer. Since the operations in steps S203 and S204 performed on each layer of neurons are no different from those described above, they will not be repeated here.
[0106] S205. Compare the output result processed by the activation function with the expected training data, construct the cost function, and obtain the gradient corresponding to all node positions on the entire matrix by taking the partial derivative of the cost function in each direction.
[0107] It is understandable that in this embodiment, when obtaining the gradient corresponding to all node positions in the entire matrix, it is done by taking the partial derivative of the cost function in each direction. The gradient g can be expressed as follows:
[0108]
[0109] In equation (7), w j,k Let E represent the feature weight of the j-th parameter on the output neuron of node k, and let E represent the cost function currently used. Specifically, in this embodiment, the output result processed by the activation function is compared with the expected training data, and the cost function is constructed accordingly.
[0110] For example, in practical applications, the cost function E can be constructed using the squared difference of the comparisons, and its formula is expressed as follows:
[0111] E = ∑ n (T n -o n ) 2 (8)
[0112] Where T represents the expected result and o represents the output result. Substituting equation (8) into equation (7) and simplifying, we get:
[0113]
[0114] S206. Update the feature weights of the neuron structure based on the gradient parameter data.
[0115] Specifically, as an optional implementation, in this embodiment, the feature weights under the neuron structure are updated based on the gradient parameter data, and the following update formula can be used:
[0116] w′←w-αg (10)
[0117] Where w' represents the updated feature weights, w represents the original feature weights, α represents the learning rate, and g represents the gradient.
[0118] Understandably, in the above update formula, the gradient g can be calculated in step S205. It represents the slope of the result obtained by the current feature weight at the corresponding cost position. In other words, the further the current result is from the expected result, the further the current weight is from the correct feature weight, and the larger the gradient will be. Therefore, the next update needs a larger step size to achieve faster convergence. The learning rate α is a constant used to control the step size of each update. If the update step size is too large, the feature weight may become unable to converge because an update crosses the optimal interval. Therefore, the learning rate is usually set relatively small, typically 0.01.
[0119] Furthermore, in practical applications, the randomly assigned feature weights are inevitably far from the correct weights at the beginning of the iteration. However, to ensure final convergence and optimization results, the step size cannot be too large. Therefore, it is best to use an optimization algorithm that gradually reduces the step size as the number of iterations increases and the gradient changes. In this embodiment, the design follows the optimization approach of AdamOptimizer, combining the data processing logic of Momentum and RMSprop to correct the skewing and accelerate the overall convergence speed of the neural network.
[0120] Specifically, as a preferred implementation, this embodiment updates the feature weights under the neuron structure based on gradient parameter data, and the following optimized update formula can be used:
[0121]
[0122] In equation (11), t represents the round, v t s represents the exponentially weighted average of the gradients over t rounds. t G represents the exponential moving average of the gradient over t rounds. t The gradient is calculated over t rounds, and ε is a smoothing term. To avoid excessively large step sizes when the denominator is too small, ε can be taken as 10 in practical applications. -8 Furthermore, v t and s t The calculation formula can be as follows:
[0123] v t =β1v t-1 -(1-β1)g t (12)
[0124] s t=β2s t-1 -(1-β2)g t 2 (13)
[0125] β1 and β2 are constant parameters used to control the decay rate and adjust the neural network model. In practical applications, β1 can be 0.9 and β2 can be 0.999.
[0126] Understandably, in the first few rounds, since v0 and s0 are both 0, the feature weights assigned to the gradient by the algorithm become extremely small, resulting in very poor training efficiency. Therefore, in practical applications, v0 can be adjusted accordingly. t and s t To perform deviation correction, the parameters shown below can be used. Alternative weighted average v t and the parameters represented as follows Alternative exponential moving average s t :
[0127]
[0128] S207. Repeat the iteration until the neural network judgment results converge, obtain the feature weights and bias values of the fully connected layer, and use them to obtain a trained neural network with the ability to judge the path nodes with the fewest relays in the topology.
[0129] Understandably, determining whether a neural network has converged requires that the current training effect of the neural network meets the following conditions: the average accuracy of the overall judgment results of the neural network is higher than 99.9%, the oscillation range of the judgment results is no higher than 0.1%, and there is no significant tendency for the accuracy to increase in the most recent 100 iterations. When the above conditions are met, the neural network can be considered to have converged and training is complete. By fixing the feature weights and bias values of the fully connected layers at this point, a trained neural network with the ability to determine the path nodes with the fewest relays in the topology can be obtained. This neural network can then be used as a judgment network in subsequent practical applications.
[0130] In subsequent practical applications, before the topological data to be judged is put into the neural network for judgment, it is also necessary to preprocess the topological data in the same way as step S1 (i.e. step S3). Since the preprocessing scheme is no different from the content of step S1, it will not be described again here.
[0131] As can be seen from the above, this invention, based on machine learning principles, implements a route optimization scheme with the fewest relays using a convolutional neural network model. It can iteratively train itself using training data to acquire abstract features in the topology, thereby obtaining the working path with the fewest relays in the overall network. Compared to the traditional KSP algorithm, which fails to consider implicit features in the graph structure, the convolutional neural network of this invention does not rely on predetermined feature parameters to obtain results. Instead, it extracts suitable implicit features from the completed result data, obtains appropriate judgment methods through data accumulation training, and then generates results for other topologies, thus completely solving the problem that the traditional KSP algorithm cannot obtain the fewest relay paths. Furthermore, the convolutional neural network of this invention, after training, possesses accuracy and computational efficiency far exceeding traditional algorithms. Because it is independent of the complexity of the topology itself, it still exhibits excellent processing performance in networks with a large number of nodes and extremely high complexity, meeting the needs of practical applications.
[0132] To better understand the overall process of the CNN-based routing method in this application, the following will combine... Figure 6 As shown, a specific example is used to illustrate the overall implementation process of Embodiment 1 above. Figure 6 As shown, a CNN-based routing method includes the following steps:
[0133] S601. Obtain the node association table of the training set topology. Unfold the nodes in the table sequentially along the horizontal and vertical axes of the matrix. Fill the intersections of the matrix with the OSNR values of the directly connected links between two nodes. Treat the OSNR values between nodes that cannot be directly connected as 0. If, after tiling, the parts that still cannot be filled to satisfy the convolution input size of 200×200×1, fill them with 0. Figure 3 As shown;
[0134] S602. Put the matrix into the convolutional layer for convolution processing. Use 16 convolutional kernels of size 5×5×1 and a stride of 3 for convolution processing. After completing one convolution according to the above convolution processing logic, a fixed-length matrix of size 66×66×16 can be obtained.
[0135] S603. Max pooling is performed using a filter size F=2 and a step size S=2 for moving the filter. The fixed-length matrix of size 66×66×16 obtained after the previous convolution is extracted into a matrix of size 33×33×16.
[0136] S604. Repeat steps S602 to S603 to perform a second convolution and a second max pooling process. When performing the second convolution, use 12 3×3×16 convolution kernels with a stride of 2. Then use a filter of size 2 with a stride of 2 to perform the second max pooling process. Finally, a matrix of size 8×8×12 is obtained.
[0137] S605. The 8×8×12 matrix is horizontally expanded to obtain a 1×1×768 one-dimensional matrix, and this matrix is used as a parameter in the neuron structure for fully connected layer network computation; the computational structure of each neuron layer under the fully connected structure can be used... This means that the two parameters, feature weight w and bias θ, are randomly assigned during the initialization of the neural network model, and the feature weight w will be continuously optimized by forward propagation.
[0138] S606. Use the ReLU activation function to process the neuron outputs obtained from fully connected layer networks. Its function structure is available in [the original text]. This indicates that λ is 1; the processed neuron output
[0139] S607. Enter the DropOut structure and complete the DropOut processing. The DropOut coefficient is 0.7, which means that 70% of the nodes in each layer will be dropped. This processing is mainly to avoid the network from overfitting due to the influence of some interference samples, which would lead to a decrease in judgment ability. After the activation function and DropOut processing, each neuron will be used as a feature of the next layer to participate in the calculation of the next layer.
[0140] S608. Since the fully connected layer network structure used in this example is a four-layer network structure of 768×600×600×200, repeat steps S605 to S607 three times until the calculation of the four fully connected layers is completed; the final result is a matrix of 200×1 structure, where nodes equal to 0 are unselected nodes and nodes greater than 0 are selected nodes.
[0141] S609. Compare the output results with the expected training data to construct the cost function E = ∑ n (T n -o n ) 2 The gradients at all node positions in the entire matrix are obtained by taking the partial derivatives of the cost function in each direction. Where T represents the expected result and o represents the output result;
[0142] S610. Update the feature weights of the neuron structure based on the gradient parameter data; the update formula is as follows: t represents the round, vt s represents the exponentially weighted average of the gradients over t rounds. t G represents the exponential moving average of the gradient over t rounds. t Let be the gradient calculated after t epochs, α be the learning rate (0.01), and ε be the smoothing term (10). -8 ;
[0143] S611. Repeat steps S601 to S610 for iterative training until the overall judgment result of the neural network converges (the average accuracy of the overall judgment result of the neural network is higher than 99.9%, the oscillation amplitude of the judgment result of the neural network is no higher than 0.1%, and there is no obvious tendency for the accuracy to increase in the most recent 100 iterations). Obtain the feature weights and bias values of the fully connected layer, and use them to obtain a trained neural network with the ability to judge the path nodes with the fewest relays in the topology.
[0144] S612. The topology data to be judged is preprocessed into data parameters that can be used by the convolution kernel to extract features. The preprocessed data parameters are put into the trained neural network for judgment (that is, steps S602 to S608 are executed to obtain the judgment result). The corresponding node is selected based on the judgment result and the route with the fewest relays is obtained accordingly.
[0145] Example 2
[0146] See Figure 7 As shown, based on the same inventive concept, this embodiment of the invention also provides a CNN-based routing system that implements the method in the first embodiment. The system includes:
[0147] The preprocessing unit is used to preprocess the topological data of the training set or the topological data that needs to be judged into data parameters that can be used by the convolutional kernel to extract features.
[0148] The training unit is used to compare the preprocessed training set data parameters with the training expectation data after the judgment processing of convolution, pooling and fully connected layers, and complete the forward propagation based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained.
[0149] The judgment and processing unit is used to input the preprocessed topology data parameters to be judged into the trained neural network for judgment, and select the corresponding node based on the judgment result of the neural network to obtain the route with the fewest relays.
[0150] As described above, in this embodiment, the preprocessing unit can preprocess the topological data of the training set or the topological data to be judged to transform it into a data form that can be used to extract features using convolutional kernels. Then, the training unit iteratively trains the preprocessed training set data to obtain a neural network capable of judging the path nodes with the fewest relays in the topology. Finally, the judgment processing unit feeds the topological data parameters to be judged into the trained neural network for judgment, and uses the judgment results of the neural network to select the corresponding nodes and obtain the path with the fewest relays. This embodiment of the invention is based on machine learning principles and implements a path selection scheme for the path with the fewest relays using a convolutional neural network model. Compared with the traditional KSP algorithm, which fails to consider the implicit features in the graph structure, the convolutional neural network of this embodiment does not rely on predetermined feature parameters to obtain results. Instead, it extracts suitable implicit features from the completed result data, obtains a suitable judgment method through data accumulation training, and generates results for other topologies accordingly, thus completely solving the problem that the traditional KSP algorithm cannot obtain the path with the fewest relays. Furthermore, the convolutional neural network of this invention has far superior accuracy and computational efficiency compared to traditional algorithms after training. Moreover, since it is independent of the complexity of the topology itself, it still has excellent processing performance in networks with a large number of nodes and extremely high complexity, thus meeting the needs of practical applications.
[0151] It should be noted that the various variations and specific examples in the foregoing method embodiments are also applicable to the system in this embodiment. Through the detailed description of the foregoing method, those skilled in the art can clearly understand the implementation method of the system in this embodiment. Therefore, for the sake of brevity, they will not be described in detail here.
[0152] Note: The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0153] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0154] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0155] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0157] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A routing method based on CNN, characterized in that, The method includes: S1. Preprocess the topological structure data of the training set into data parameters that can be used by the convolution kernel to extract features; S2. After the preprocessed data parameters are processed by convolution, pooling and fully connected layers, they are compared with the training expectation data and forward propagation is completed based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained. S3. Preprocess the topological data that needs to be judged into data parameters that can be used by the convolution kernel to extract features; S4. Input the preprocessed data parameters into the trained neural network for judgment, select the corresponding node using the judgment result of the neural network, and obtain the route with the fewest relays accordingly. Step S2 includes: Input convolution kernel parameters for convolution processing, and use the convolution kernel to convert the preprocessed data parameters into a fixed-length matrix; Max pooling is used to shrink the matrix size and extract the main features; The obtained matrix is expanded into a one-dimensional matrix, and this one-dimensional matrix is used as a parameter to perform fully connected layer network calculations in the neuron structure. Use activation functions to process the neuron outputs obtained from fully connected layer networks; The output of the activation function is compared with the expected training data to construct a cost function. The gradients at all node positions in the entire matrix are obtained by taking the partial derivatives of the cost function in each direction. Update the feature weights of the neuron structure based on the gradient parameter data; Repeat the iteration until the neural network's overall judgment result converges, obtain the feature weights and bias values of the fully connected layers, and use these to obtain a trained neural network that has the ability to determine the path nodes with the fewest relays in the topology.
2. The CNN-based routing method as described in claim 1, characterized in that, Step S1 specifically includes: The nodes in the topology of the training set are unfolded sequentially in the horizontal and vertical directions of the matrix. The intersection of the matrix is filled with the OSNR value of the direct connection between two nodes. The OSNR value between nodes that cannot be directly connected is considered to be 0. After the tiling is completed, the part that still cannot be filled to meet the convolution input size is filled with 0.
3. The CNN-based routing method as described in claim 1, characterized in that, The logic for performing convolution processing can be represented by the following formula: In the formula, This indicates that the output fixed-length matrix is in ( i , j ) Parameters at coordinate positions, Indicates that the convolution kernel is in ( u , v ) Parameters at coordinate positions, Indicates that the input matrix is in ( u , v ) Parameters at coordinate positions, U and V This represents the length and width of the convolution kernel.
4. The CNN-based routing method as described in claim 1, characterized in that, Max pooling is used to shrink the matrix size and extract key features, specifically including: Determine the filter size F and the step size S for moving the filter. Starting from the initial position, extract the maximum value of the parameters within the range [F, F] of the original matrix input to the pooling layer, and use this as the result at the corresponding position in the output matrix of the pooling layer. Then, move the filter S parameters along the positive direction of the matrix and repeat the above operation until the entire original matrix is extracted into a single matrix with a height of... H 2= +1, width W 2= The result matrix is +1, where H 1 and W 1 represents the height and width of the original matrix input to the pooling layer.
5. The CNN-based routing method as described in claim 1, characterized in that: The neuron structure can be represented by the following formula: In the formula, y This indicates the output of the neuron. Indicates the first in the output of the previous layer i One result, n The size of the input matrix. This indicates that the neuron affects the first... i Each output feature weight, This indicates the bias towards that neuron.
6. The CNN-based routing method as described in claim 1, characterized in that, The formula for calculating the gradient is: In the formula, w j,k for k The first neuron on the output node j Feature weights of each parameter E This represents the cost function currently in use.
7. The CNN-based routing method as described in claim 1, characterized in that, When updating the feature weights of the neuron structure based on the gradient parameter data, the following update formula is used: In the formula, This represents the updated feature weights. Represents the original feature weights. Indicates the enrollment rate, This represents the gradient.
8. The CNN-based routing method as described in claim 1, characterized in that, When updating the feature weights of the neuron structure based on the gradient parameter data, the following update formula is used: In the formula, This represents the updated feature weights. Represents the original feature weights. Indicates the enrollment rate, express t The exponentially weighted average of gradients across rounds. express t The exponential moving average of the gradient in each round, for t The gradient calculated in each round, This is a smoothing term.
9. A CNN-based routing system implementing the method of any one of claims 1 to 8, characterized in that, The system includes: The preprocessing unit is used to preprocess the topological data of the training set or the topological data that needs to be judged into data parameters that can be used by the convolutional kernel to extract features. The training unit is used to compare the preprocessed training set data parameters with the training expectation data after the judgment processing of convolution, pooling and fully connected layers, and complete the forward propagation based on the cost function and gradient descent principle. Through repeated iterative training, a neural network with the ability to judge the path nodes with the fewest relays in the topology is obtained. The judgment and processing unit is used to input the preprocessed topology data parameters to be judged into the trained neural network for judgment, and select the corresponding node based on the judgment result of the neural network to obtain the route with the fewest relays.
Citation Information
Patent Citations
Wireless routing optimization method based on attention mechanism and deep reinforcement learning
CN114423061A
Training method of network routing path planning model, and path planning method and device
CN117729143A