A method and apparatus for joint path and wavelength allocation for WSON
By learning edge costs and wavelength preferences through graph neural networks and combining them with enhanced state space search, the hard constraint problem in dynamic network states in WSON is solved, enabling fast and reliable optical path generation and improving computational efficiency and response capability.
Patent Information
- Application Number
- CN202611287214.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-10
AI Technical Summary
Existing technologies in WSON struggle to quickly generate heuristic costs that reflect real-time resource congestion under dynamically changing network conditions, and cannot strictly guarantee that the output optical path meets hard constraints such as wavelength conflict, converter capacity, and OSNR, resulting in high blocking rates and low computational efficiency.
By employing a graph neural network to learn edge costs and wavelength preferences, combined with enhanced state space search, and rigorously checking hard constraints through no-wavelength-change and wavelength-change expansion rules, Top-K candidate optical paths are generated.
It significantly improves online computing speed and dynamic service response capabilities, ensures the physical feasibility of the output optical path, reduces the number of invalid extension nodes, and is suitable for network environments with only historical data.
Smart Images

Figure CN123075306A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical communication network resource scheduling technology, and specifically to a path and wavelength joint allocation method and apparatus for WSON. Background Technology
[0002] Wavelength-Switched Optical Network (WSON) is a core technology of next-generation optical transport networks, transmitting multiple wavelengths of optical signals simultaneously in a single optical fiber using wavelength division multiplexing (WDM) technology. In WSON, when a service request arrives dynamically, an optical path from the source node to the destination node needs to be calculated and allocated in real time. This path includes the path itself (which nodes and links it passes through) and the wavelength sequence (which wavelength is used on each link). This process is called Routing and Wavelength Assignment (RWA).
[0003] The RWA problem in WSON is subject to the following key constraints: First, wavelength continuity constraint: if a wavelength converter is not used on the path, the same service must use the same wavelength on all links. Second, wavelength conflict constraint: the same wavelength on the same link cannot be occupied by multiple services simultaneously. Third, wavelength converter constraint: only some nodes have wavelength conversion capabilities, and the converter capacity is limited, consuming 1 unit of capacity for each wavelength conversion. Fourth, optical signal-to-noise ratio (OSNR) constraint: the end-to-end OSNR must meet a preset hard threshold; otherwise, signal quality cannot be guaranteed.
[0004] Existing technical solutions include traditional shortest path algorithms, traditional heuristic search (A* search), end-to-end neural network methods, and Integer Linear Programming (ILP) methods.
[0005] Traditional graph algorithms such as Dijkstra's algorithm and Yen's algorithm (K shortest paths) calculate paths based solely on topological distance or hop count, completely disregarding real-time resource information such as wavelength occupancy status, converter location, and capacity. In dynamic service arrival scenarios, the paths calculated by these algorithms are often infeasible due to wavelength resource conflicts or insufficient converters, leading to persistently high blocking rates. They fail to reflect real-time wavelength occupancy status; cannot consider the location and capacity limitations of wavelength converters; cannot assess the satisfiability of OSNR constraints; and generate a large number of infeasible solutions under resource constraints, resulting in low search efficiency.
[0006] In traditional heuristic search, the A* algorithm estimates the cost from the current node to the target node using a heuristic function to guide the search direction. Traditional A* applications in WSON typically employ manually designed heuristic functions, such as shortest path distance, hop count, or simple link load weights. These manually designed heuristic functions have fixed parameters, making them difficult to adapt to dynamic changes in network conditions; they cannot reflect the real-time congestion status of wavelength converters; they cannot learn implicit patterns from historical service data; and in highly dynamic, large-scale networks, they result in excessively high computational overhead when expanded to include too many nodes.
[0007] In recent years, some studies have attempted to use end-to-end neural networks (such as sequence-to-sequence models and reinforcement learning) to directly output path and wavelength sequences. These methods model the Restricted Path Analysis (RWA) problem as a sequence generation problem, with the neural network outputting a complete optical path solution at once. However, the neural network output struggles to strictly guarantee the feasibility of hard constraints. It may output illegal solutions where the same wavelength is repeatedly used on the same link, perform wavelength conversion at non-converter nodes, exceed the converter's capacity limit, or fail to meet the OSNR hard threshold. Furthermore, generating illegal solutions requires additional repair mechanisms, increasing system complexity. The high risk of implementation makes it difficult to deploy in real-world networks.
[0008] Integer Linear Programming (ILP) models the RWA problem as an integer programming problem and uses a solver to find the global optimum. In large-scale networks (such as 1000 nodes and 100,000 links) and highly dynamic business scenarios, the problem size expands dramatically; the computational complexity is extremely high, making it difficult to meet the needs of online real-time computing (usually requiring response times in seconds or even milliseconds); it places stringent demands on computing resources and is not suitable for practical network deployment. Summary of the Invention
[0009] To rapidly generate heuristic costs reflecting real-time resource congestion under dynamically changing network conditions and reduce invalid expansion during the search process, this invention leverages the learning capabilities of neural networks while strictly ensuring that the output optical path meets hard constraints such as wavelength conflict, converter capacity, and OSNR to avoid generating illegal solutions. This embodiment of the invention provides a path and wavelength joint allocation method and apparatus for WSON.
[0010] In a first aspect, embodiments of the present invention provide a path and wavelength joint allocation method for WSON, comprising:
[0011] The current WSON network is modeled as a directed graph; where in the directed graph G=(V,E), V is the set of nodes and E is the set of directed links;
[0012] For each link in the link set, construct a wavelength availability state mask vector based on whether the wavelength is occupied, and obtain the corresponding low-dimensional vector, the proportion of the current available wavelengths to the total number of wavelengths, and the normalized value of the physical length. Concatenate these to obtain the edge feature vector.
[0013] For each node in the node set, construct a node feature vector based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node.
[0014] Obtain the currently pending business requests, and construct a request vector based on the initial embeddings and distance encodings of the source and destination nodes in the business requests;
[0015] The directed graph, node feature vectors, edge feature vectors, and request vectors are input into the request conditional graph neural network model to obtain the edge cost score for each link and the wavelength preference score for each node.
[0016] Based on the enhanced state in the enhanced state space, and according to preset hard constraints, an optical path search is performed in the enhanced state space based on a pre-constructed cumulative cost function including expansion cost and heuristic cost to obtain K candidate optical paths. Each optical path includes a path and a wavelength sequence. The enhanced state includes at least the current node and the current wavelength sequence. The expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term. Based on the wavelength preference score, only the Top-M candidate wavelengths are expanded at the wavelength switching node. The heuristic cost includes the estimated remaining cost from the current node to the target node.
[0017] In one or more optional embodiments, when performing optical path search in the enhanced state space, state extension is performed based on the following non-wavelength extension rule and wavelength extension rule:
[0018] No-wavelength expansion rule: For each outgoing link from the current node v, perform the following checks: Determine that the current wavelength on the current link is available, and calculate that the updated OSNR budget after passing through the current link is not less than 0; If the above no-wavelength expansion rule check conditions are met, generate a new state and calculate the cumulative cost.
[0019] Wavelength switching extension rules: Wavelength switching is allowed only when the current node is a converter node and the remaining capacity of the converter is greater than 0. If the wavelength switching extension rules are met, the following steps are executed:
[0020] Obtain the wavelength preference score for the current node;
[0021] Select the Top-M candidate wavelengths based on wavelength preference scores;
[0022] For each candidate wavelength, the non-wavelength expansion rule check is performed. If the non-wavelength expansion rule check conditions are met, a new state is generated, the cumulative cost is calculated, the number of wavelength changes is incremented by 1, and the remaining capacity of the converter is decremented by 1.
[0023] In one or more optional embodiments, the preset hard constraint conditions include:
[0024] The same wavelength on the same link cannot be repeatedly occupied by multiple services;
[0025] The wavelength can only be changed at nodes with wavelength conversion capabilities, and each wavelength conversion consumes the wavelength converter capacity of that node.
[0026] The end-to-end OSNR of the candidate optical path meets the preset hard threshold.
[0027] In one or more optional embodiments, the enhanced states of the enhanced state space are:
[0028] s=(v,λ,sw,osnr_budget),
[0029] Where v is the current node, λ is the current wavelength, sw is the cumulative number of wavelength changes, and osnr_budget is the remaining OSNR budget.
[0030] In one or more optional embodiments, for each link in the link set, a wavelength availability state mask vector is constructed based on whether the wavelength is occupied, resulting in a corresponding low-dimensional vector, the proportion of currently available wavelengths to the total number of wavelengths, and a normalized physical length value. These are then concatenated to obtain an edge feature vector, including:
[0031] For each link in the link set, construct a wavelength availability state mask vector based on whether the wavelength is occupied. , where W is the number of wavelengths, and the value of the λth dimension is 1, which means that the λth wavelength on link e is currently available for new service allocation, and the value of 0 means that the wavelength has been occupied or is unavailable;
[0032] The encoder compresses the wavelength available state mask vector into a low-dimensional vector. Where d is the dimension;
[0033] Based on the wavelength availability state mask vector, calculate the proportion of currently available wavelengths to the total number of wavelengths on each link: :
[0034] Based on the wavelength available state mask vector, calculate the normalized physical length value for each link: Where L(e) represents the actual physical length of the current link e, Lmin represents the minimum length among all links in the current directed graph, Lmax represents the maximum length among all links in the current directed graph, and ε is a very small positive number;
[0035] Based on the low-dimensional vector, the proportion of currently available wavelengths to the total number of wavelengths, and the normalized physical length value, the edge feature vector is obtained by concatenation: .
[0036] In one or more alternative embodiments, the encoder is a multilayer perceptron.
[0037] In one or more optional embodiments, for each node in the node set, constructing a node feature vector based on whether the node is a converter node, the normalized value of the converter's remaining capacity, and the node's in-degree and out-degree includes:
[0038] For each node v in the node set, construct the following 4-dimensional feature vector as the node feature vector based on whether the node is a converter node, the normalized value of the converter's remaining capacity, and the node's in-degree and out-degree:
[0039]
[0040] in,
[0041] , This indicates the remaining wavelength conversion capacity of node v. This indicates that node v has already occupied the wavelength conversion capacity. This represents the total wavelength conversion capacity of the node; in_deg(v) is the in-degree of node v; out_deg(v) is the out-degree of node v.
[0042] In one or more optional embodiments, obtaining the currently assigned service request and constructing a request vector based on the initial embeddings and distance encodings of the source and destination nodes in the service request includes:
[0043] Get the currently pending business requests;
[0044] The node features of the source node and the destination node in the service request are linearly transformed to obtain the corresponding initial embeddings;
[0045] Determine the distance encoding between the source node and the destination node in the service request;
[0046] Based on the initial embeddings and distance encodings of the source and destination nodes in the business request, construct the request vector:
[0047] q=f([h_s]||[h_t]||[dist_encoding(s,t)])
[0048] Where h_s and h_t are the initial embeddings of the source node s and the destination node t, respectively; dist_encoding(s,t) is the distance encoding representation between the source and destination nodes.
[0049] In one or more optional embodiments, the method includes calculating an edge cost score based on the following edge cost score calculation formula:
[0050] = ,
[0051] in, and Here, e represents the endpoint node embedding of the graph neural network output. Let q be the original feature of the edge itself, q be the request vector, and f(·) be the edge cost head network.
[0052] In one or more optional embodiments, the method includes calculating a wavelength preference score based on the following wavelength preference score calculation formula:
[0053] ,in , belong , where is the learnable embedding vector for the λ-th wavelength.
[0054] In one or more optional embodiments, the cumulative cost function is:
[0055] f(u) = g(u) + h(u);
[0056] The expansion cost g(u) is:
[0057] ,in, This represents the cumulative cost to reach node v. This represents the length cost of link e. Scoring the edge cost Indicates wavelength conversion penalty. α is the remaining converter capacity of node v; α is the path length penalty coefficient; β is the wave-changing penalty coefficient; β2 is the converter capacity penalty coefficient.
[0058] The heuristic cost h(u) is:
[0059] ,in, This represents the shortest path distance from the current node u to the destination node t. This is the heuristic adjustment coefficient.
[0060] In one or more optional embodiments, the method further includes updating resources in the following manner:
[0061] After selecting one of the K candidate optical paths for actual allocation, update the network resource status:
[0062] Update link wavelength occupancy status: Mark each link e and each wavelength λ used by the optical path as occupied;
[0063] Update converter node capacity: For each node v in the optical path that performs wavelength conversion, execute conv_rem(v)=conv_rem(v)-1;
[0064] Record OSNR-related parameters: Record the actual end-to-end OSNR of this optical path.
[0065] In one or more alternative embodiments, the request-conditionalized graph neural network model employs... Alternatively, a graph attention network can be used, and training and inference on large-scale graphs can be achieved through neighbor sampling.
[0066] In one or more alternative embodiments, the request-conditionalized graph neural network model is trained in the following manner:
[0067] Obtain a training sample set, where each training sample includes historical business requests and corresponding network states;
[0068] For each training sample, a directed graph is constructed based on the network state, node feature vectors and edge feature vectors are constructed, and a request vector is constructed based on the business request.
[0069] Multiple candidate paths are generated using traditional search path algorithms, and constraint filtering is performed to obtain a set of feasible candidate optical paths.
[0070] For each feasible candidate optical path in the set of feasible candidate optical paths for each training sample, a comprehensive score is calculated based on the multi-objective comprehensive scoring function;
[0071] The feasible candidate optical paths for each training sample are sorted according to their comprehensive scores, and the top n% of optical paths are labeled as positive and negative samples.
[0072] Construct a set of preference pairs based on all positive and negative samples;
[0073] Based on the directed graph, node feature vector, edge feature vector, and request vector of each training sample, forward computation is performed on the input request conditional graph neural network model to be trained to obtain the edge cost score of each link and the wavelength preference score of each converter node.
[0074] For each feasible candidate optical path, a model prediction score is calculated based on a preset model prediction scoring function;
[0075] For each preference pair, predict the score based on the corresponding model, minimize the pairwise ranking loss, and adjust the model parameters through backpropagation.
[0076] The model training process is repeated until the preset conditions are met, thus obtaining the requested conditional graph neural network model.
[0077] In one or more optional embodiments, constraint filtering is performed on multiple candidate paths generated using a conventional search path algorithm for each training sample, including:
[0078] Wavelength availability check: Checks whether there are available wavelengths on each link of the candidate path;
[0079] Converter validity check: Check whether the wave-changing point in the candidate path is a converter node;
[0080] Converter capacity verification checks whether the remaining capacity of the converter nodes in the candidate path meets the wave switching requirements.
[0081] OSNR threshold verification checks whether the end-to-end OSNR in the candidate path meets the preset hard threshold requirement.
[0082] In one or more optional embodiments, the multi-objective comprehensive scoring function is:
[0083]
[0084] in, This represents the total cost of the path. This indicates the number of wave switching events that occur in the candidate path. This represents the set of nodes where wave switching occurs. Let α represent the converter stress penalty function, where α is the path length penalty coefficient, β is the wave switching penalty coefficient, and β2 is the converter capacity penalty coefficient.
[0085] In one or more optional embodiments, the model predicts the scoring function:
[0086]
[0087] In one or more optional embodiments, the pairwise ranking loss function is:
[0088] .
[0089] Secondly, embodiments of the present invention provide a path and wavelength joint allocation device for WSON, comprising:
[0090] The first building block is used to model the current WSON network as a directed graph;
[0091] The second construction module is used to construct a wavelength availability status mask vector for each link in the link set based on whether the wavelength has been occupied, and obtain the corresponding low-dimensional vector, the proportion of the number of currently available wavelengths to the total number of wavelengths, and the normalized value of the physical length, and then concatenate them to obtain the edge feature vector.
[0092] The third construction module is used to construct a node feature vector for each node in the node set based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node.
[0093] The fourth construction module is used to obtain the currently unassigned business requests and construct a request vector based on the initial embedding and distance encoding of the source and destination nodes in the business requests.
[0094] The model evaluation module is used to input the directed graph, node feature vectors, edge feature vectors and the request vector into the request conditional graph neural network model to obtain the edge cost score of each link and the wavelength preference score of each node.
[0095] An enhanced search module is used to perform optical path search in the enhanced state space according to the enhanced state space and preset hard constraints, based on a pre-constructed cumulative cost function including expansion cost and heuristic cost, to obtain K candidate optical paths. Each optical path includes a path and a wavelength sequence. The enhanced state includes at least the current node and the current wavelength sequence. The expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term, and expands only the Top-M candidate wavelengths at the wavelength switching node based on the wavelength preference score. The heuristic cost includes the estimated residual cost from the current node to the target node.
[0096] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, characterized in that, when executed by a processor, the program implements the path and wavelength joint allocation method for WSON as described in the first aspect.
[0097] Fourthly, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the program, implements the path and wavelength joint allocation method for WSON as described in the first aspect.
[0098] Fifthly, embodiments of the present invention provide a computer program product containing instructions that, when run on a computer device, cause the computer device to execute the path and wavelength joint allocation method for WSON as described in the first aspect.
[0099] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0100] The path and wavelength joint allocation method for WSON provided in this invention introduces a graph neural network (GNN) to combine the real-time wavelength occupancy status of links, the remaining capacity of wavelength converters at nodes, and the source and destination node information of service requests. This learns and generates edge cost scores and wavelength preference scores that are highly correlated with the current network state, serving as heuristic costs in the enhanced state space search process, replacing the traditional manual fixed heuristic. Because this heuristic accurately reflects the degree of link congestion and converter stress, the search process prioritizes expansion towards resource-rich and low-cost directions, reducing the number of A* expansions and significantly decreasing the number of invalid expansion nodes caused by blindly exploring infeasible paths. This greatly improves online computing speed and dynamic service response capabilities.
[0101] The path and wavelength joint allocation method for WSON provided in this invention adopts a "learning heuristic + hard constraint search" approach, fundamentally solving the problem that end-to-end neural network solutions cannot guarantee physical layer hard constraints. The graph neural network is only responsible for generating the edge costs and wavelength preferences that guide the search direction, while the final feasible optical path generation is completed through enhanced state space search with hard constraints. When expanding the state, all hard constraints are forcibly checked and satisfied, ensuring that any optical path output by the model is necessarily a physically feasible legal solution, avoiding the high landing risk caused by the generation of illegal solutions in traditional end-to-end methods.
[0102] The path and wavelength joint allocation method for WSON provided in this invention employs a ranking-based training method without optimal labels during model training. This method trains heuristic scoring without requiring globally optimal labels, making it suitable for scenarios with only historical data. It effectively solves the problem of obtaining globally optimal solutions as training labels in actual network operation and maintenance. This method utilizes traditional algorithms (such as KSP and A) to quickly generate a batch of feasible candidate optical paths and can simultaneously obtain multiple candidate optical paths under multi-objective constraints, facilitating subsequent strategy selection or protection mechanism expansion. These candidate solutions are ranked according to the comprehensive scoring function J(l) of the multi-objectives, automatically distinguishing relatively superior candidate pairs. The model is trained using Pairwise ranking loss, with the core objective being to ensure that the scoring order predicted by the model is consistent with the ranking order of J(l). In this way, the neural network only needs to continuously learn and imitate ranking preferences to gradually approach the multi-objective optimization objective, thereby generating a better search guidance cost in a dynamic network environment.
[0103] The path and wavelength joint allocation method for WSON provided in this embodiment of the invention constructs a low-dimensional vector corresponding to the wavelength available state mask vector by low-dimensional embedding of wavelength mask, avoiding repeated transfer of multi-dimensional features on a large-scale edge set and reducing the amount of computation.
[0104] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0105] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0106] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0107] Figure 1 This is a flowchart illustrating the path and wavelength joint allocation method for WSON provided in an embodiment of the present invention.
[0108] Figure 2 This is a schematic diagram of the training process of the request-conditional graph neural network model provided in an embodiment of the present invention;
[0109] Figure 3 This is a schematic diagram of the mechanism of the request conditional graph neural network model provided in an embodiment of the present invention;
[0110] Figure 4This is a structural block diagram of the path and wavelength joint allocation device for WSON provided in an embodiment of the present invention;
[0111] Figure 5 This is a structural block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0112] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0113] To overcome the following technical problems in existing technologies: rapidly generating heuristic costs reflecting real-time resource congestion under dynamically changing network conditions to reduce invalid expansion during the search process; and strictly ensuring that the output optical path meets hard constraints such as wavelength conflict, converter capacity, and OSNR while utilizing the learning capabilities of neural networks to avoid generating illegal solutions, the inventors attempt to adopt a two-stage collaborative approach of "heuristic learning + hard constraint search." This approach utilizes graph neural networks to generate heuristic costs and guide constraint search to output Top-K candidate optical paths: The graph neural network learns the edge costs and wavelength preferences related to the current request / network state; a Top-K search is performed in the enhanced state space, and wavelength occupancy, converter capacity, and OSNR hard thresholds are strictly checked to achieve feasible solution output.
[0114] Based on this, the inventors conducted further research and development and developed this invention, which provides a method and apparatus for path and wavelength joint allocation for WSON.
[0115] Example 1
[0116] This invention provides a method for joint path and wavelength allocation for WSON, referring to... Figure 1 As shown, the method includes:
[0117] S101: Model the current WSON network as a directed graph; where in the directed graph G=(V,E), V is the set of nodes and E is the set of directed links;
[0118] S102: For each link in the link set, construct a wavelength availability state mask vector based on whether the wavelength has been occupied, and obtain the corresponding low-dimensional vector, the proportion of the number of currently available wavelengths to the total number of wavelengths, and the normalized value of the physical length. Concatenate these to obtain the edge feature vector.
[0119] S103: For each node in the node set, construct a node feature vector based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node.
[0120] S104: Obtain the current service request to be assigned, and construct a request vector based on the initial embedding and distance encoding of the source node and destination node in the service request;
[0121] S105: Input the directed graph, node feature vectors, edge feature vectors and the request vector into the request conditional graph neural network model to obtain the edge cost score of each link and the wavelength preference score of each node.
[0122] S106: Based on the enhanced state of the enhanced state space, and according to the preset hard constraints, an optical path search is performed in the enhanced state space based on a pre-constructed cumulative cost function including expansion cost and heuristic cost to obtain K candidate optical paths; wherein, each optical path includes a path and a wavelength sequence, and the enhanced state includes at least the current node and the current wavelength sequence; the expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term, and only the Top-M candidate wavelengths are expanded at the wavelength switching node based on the wavelength preference score, and the heuristic cost includes the estimated remaining cost from the current node to the target node.
[0123] In this embodiment of the invention, the process of obtaining the optical network topology map based on the WSON network in step S101 can be described in detail in the prior art, and no specific limitation is required here.
[0124] In this embodiment of the invention, in step S102 above, for each link in the link set, a wavelength availability state mask vector is constructed based on whether the wavelength is occupied, resulting in a corresponding low-dimensional vector, the proportion of currently available wavelengths to the total number of wavelengths, and a normalized physical length value. These are then concatenated to obtain an edge feature vector, specifically including:
[0125] For each link in the link set, construct a wavelength availability state mask vector based on whether the wavelength is occupied. , where W is the number of wavelengths, and the value of the λth dimension is 1, which means that the λth wavelength on link e is currently available for new service allocation, and the value of 0 means that the wavelength has been occupied or is unavailable;
[0126] The encoder compresses the wavelength available state mask vector into a low-dimensional vector. d is the dimension;
[0127] Based on the wavelength availability state mask vector, calculate the proportion of currently available wavelengths to the total number of wavelengths on each link: :
[0128] Based on the wavelength available state mask vector, calculate the normalized physical length value for each link: Where L(e) represents the actual physical length of the current link e, Lmin represents the minimum length among all links in the current directed graph, Lmax represents the maximum length among all links in the current directed graph, and ε is a very small positive number, which serves as a protection term to prevent division by zero.
[0129] Based on the low-dimensional vector, the proportion of currently available wavelengths to the total number of wavelengths, and the normalized physical length value, the edge feature vector is obtained by concatenation: .
[0130] In this embodiment of the invention, in step S102 above, for each link in the link set, a wavelength availability state mask vector is constructed based on whether the wavelength has been occupied. This is based on the fact that each link e∈E has a length parameter and a multi-wavelength resource state, wherein the multi-wavelength resource state contains a fixed number W of available mask vectors for wavelengths. This representation is used to define the available state vector of link e across all W channels. The λ-th dimension has a value of 1 indicating that the λ-th wavelength on the link is unoccupied and available for new service allocation, while a value of 0 indicates that the wavelength is occupied or unavailable. This representation encodes the discrete wavelength occupancy status of the link into a fixed-length binary vector, facilitating subsequent input into the encoder and graph neural network for learning.
[0131] Furthermore, based on the wavelength available state mask vector The encoder produces an embedding vector, which is a low-dimensional vector. This formula indicates that the original W-dimensional wavelength can be compressed into a low-dimensional vector using the encoder enc(·) through a mask. The encoder can be implemented using a multilayer perceptron (MLP), and the output dimension d can be set to 16 or 32.
[0132] Specifically, it is to Treat it as a W-dimensional 0 / 1 vector, convert it to float, and pass it through two layers of MLP to obtain The purpose of introducing this low-dimensional encoding is twofold: firstly, to preserve the main structural information in the link wavelength occupancy pattern, and secondly, to reduce the computational complexity of subsequent graph neural network processing of high-dimensional discrete states, thereby improving inference efficiency on large-scale networks.
[0133] Define the proportion of currently available wavelengths to the total number of wavelengths on each link: This feature is a normalized measure of the remaining resources of the link, which helps the model quickly identify the level of link resource stress. The larger the value, the more wavelengths the link can choose, and the more feasible the subsequent search is. The smaller the value, the more severe the link congestion, and the higher the cost or the lower the priority should be in the search.
[0134] Normalized physical length of each link: Where L(e) represents the actual physical length of the current link e, Lmin represents the minimum length among all links in the current directed graph, Lmax represents the maximum length among all links in the current directed graph, and ε is a very small positive number used as a protection term to prevent division by zero, thus constructing the edge feature vector: .
[0135] In this embodiment of the invention, the above-mentioned number of wavelengths is also called the total number of channels, and the value is generally 80, 96 or 120.
[0136] In this embodiment of the invention, in step S103 above, for each node in the node set, a node feature vector is constructed based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node. Specifically, this includes:
[0137] For each node v in the node set, construct the following 4-dimensional feature vector as the node feature vector based on whether the node is a converter node, the normalized value of the converter's remaining capacity, and the node's in-degree and out-degree:
[0138]
[0139] in, ; , This indicates the remaining wavelength conversion capacity of node v. This indicates that node v has already occupied the wavelength conversion capacity. This represents the total wavelength conversion capacity of the node; in_deg(v) is the in-degree of node v; out_deg(v) is the out-degree of node v.
[0140] In this embodiment of the invention, A value of 1 indicates that node v is a converter node, and a value of 0 indicates that it is not a converter node.
[0141] In this embodiment of the invention, step S104 above, obtaining the current service request to be allocated, and constructing a request vector based on the initial embeddings and distance encodings of the source and destination nodes in the service request, specifically includes:
[0142] Get the current pending business request r=(s,t), where s is the source node and t is the destination node;
[0143] The node features of the source node and the destination node in the service request are linearly transformed to obtain the corresponding initial embeddings;
[0144] Determine the distance encoding between the source node and the destination node in the service request;
[0145] Based on the initial embeddings and distance encodings of the source and destination nodes in the business request, construct the request vector:
[0146] q=f([h_s]||[h_t]||[dist_encoding(s,t)])
[0147] Where h_s and h_t are the initial embeddings of the source node s and the destination node t, respectively; dist_encoding(s,t) is the distance encoding representation between the source and destination nodes.
[0148] In this embodiment of the invention, a request vector is constructed to conditionally encode the node / edge representations of the graph neural network. This enables the GNN to generate personalized representations related to the request based on specific source and destination node pairs; that is, under the same network state, different requests will receive different edge costs and wavelength preferences. Here, h_s and h_t can be obtained through linear transformation of node features x_v; dist_encoding(s,t) can be obtained using sinusoidal positional encoding or shortest path distance calculation; f(·) is the concatenated linear transformation or nonlinear mapping.
[0149] In this embodiment of the invention, in step S105 above, the directed graph G, node feature vectors, edge feature vectors, and the request vector are input into the request conditional graph neural network model, and the output is:
[0150] a) Edge cost scoring for each link e ;
[0151] b) Wavelength preference scoring for node v with wavelength conversion capability , where λ∈{1,…,W};
[0152] The edge cost score is calculated based on the following edge cost score calculation formula:
[0153] = ,
[0154] in, and Here, e represents the endpoint node embedding of the graph neural network output. Let q be the original feature of the edge itself, q be the request vector, and f(·) be the edge cost head network.
[0155] The wavelength preference score is calculated based on the following formula:
[0156] ,in , belong , where is the learnable embedding vector for the λ-th wavelength.
[0157] In this embodiment of the invention, in step S106 above, K candidate optical paths are obtained by performing a pre-K search in the enhanced state space. Each path includes a path P and a wavelength sequence Λ, wherein the enhanced state of the enhanced state space includes at least the current node v and the current wavelength λ; and the following hard constraints are satisfied simultaneously in the search expansion:
[0158] a) The same wavelength λ on the same link cannot be occupied by multiple services repeatedly. That is, the same wavelength on the same link e can only be occupied by one service at the same time. This is achieved by checking whether λ_mask(e)[λ] is 1 in real time.
[0159] b) Wavelength can only be changed at nodes with wavelength conversion capabilities, implemented by checking if is_converter(v) is 1. Each wavelength change consumes the wavelength converter capacity of that node, that is, each wavelength conversion consumes 1 unit of converter capacity, which cannot exceed the node's remaining capacity, implemented by checking if conv_rem(v) is greater than 0.
[0160] c) The end-to-end OSNR of the candidate optical path meets a preset hard threshold, which is achieved by checking whether osnr_budget is greater than or equal to 0. The preset hard threshold is determined based on the system transmission rate, modulation format, and receiver sensitivity. For example, it can be set to a preset OSNR threshold of osnr_budget ≥ 0. When the remaining OSNR budget is less than 0, it is considered infeasible.
[0161] The expansion cost of the search includes at least the cost of... Guided learning cost term and wave-swapping penalty term, and based on At the wavelength conversion node, only the Top-M candidate wavelengths are expanded to reduce the branching factor.
[0162] In this embodiment of the invention, the enhanced states of the enhanced state space are:
[0163] s=(v,λ,sw,osnr_budget),
[0164] Where v belongs to V, representing the current node; λ belongs to {1,2,...,W}, representing the currently used wavelength; sw belongs to {0,1,2,...}, representing the cumulative number of wavelength swaps; and osnr_budget is the remaining OSNR budget (initial value is a preset threshold, decreasing as the path propagates). Compared to traditional A* which only records the node position v, the enhanced state algorithm simultaneously records the wavelength, the number of wavelength swaps, and the OSNR budget, enabling the search to accurately determine the feasibility of the state under multi-dimensional constraints.
[0165] In this embodiment of the invention, the A* heuristic framework is used to define the cumulative cost function:
[0166] f(u) = g(u) + h(u);
[0167] The expansion cost g(u) is:
[0168] ,in, This represents the cumulative cost to reach node v. This represents the length cost of link e. Scoring the edge cost Indicates wavelength conversion penalty. α is the remaining converter capacity of node v; α is the path length penalty coefficient; β is the wave-changing penalty coefficient; β2 is the converter capacity penalty coefficient.
[0169] The heuristic cost h(u) is:
[0170] ,in, This represents the shortest path distance from the current node u to the destination node t. This is the total cost weight for path length, used to control the influence of path distance factors on the cumulative cost. Its value can be adjusted according to the network size.
[0171] Initialize the search process. The initial state is s_0=(s,λ_0,0,OSNR_threshold), where s is the source node and λ_0 is the initial wavelength (which can be selected through GNN wavelength preference or availability). Establish a priority queue and store the states to be expanded in order of f(u) value. Establish a visited set to record the visited (v,λ) combinations to avoid duplicate expansion.
[0172] Create a results list and store the K feasible candidate optical paths found.
[0173] Take the state s=(v,λ,sw,osnr_budget) with the smallest f value from the priority queue, and perform state expansion based on the following non-wavelength expansion rules and wavelength expansion rules.
[0174] No-wavelength expansion rule: For each outgoing link e = (v→u) from the current node v belonging to E, perform the following checks: Determine if the current wavelength on the current link is available, and check if λ_mask(e)[λ] is equal to 1, i.e., the current wavelength λ on link e must be available. Also, calculate that the updated OSNR budget after passing through the current link is not less than 0, i.e., osnr_budget' = osnr_budget - osnr_degradation(e,λ), requiring osnr_budget' to be greater than or equal to 0, where osnr_degradation(e,λ) is the OSNR attenuation of link e at wavelength λ. If the above no-wavelength expansion rule check conditions are met, generate a new state and calculate the cumulative cost;
[0175] Waveform swapping extension rule: Waveform swapping is allowed only when the current node is a converter node (is_converter(v)=1) and the remaining capacity of the converter is greater than 0 (conv_rem(v)>0). If the waveform swapping extension rule is met, the following steps are executed:
[0176] Obtain the wavelength preference score logits_v(λ) of the current node, where λ belongs to {1,...,W};
[0177] Select the Top-M candidate wavelengths based on wavelength preference scores (arranged in descending order of wavelength preference scores; the value of M can be determined according to the actual situation, for example, 3 to 5).
[0178] For each candidate wavelength, the non-wavelength expansion rule check is performed. If the non-wavelength expansion rule check condition is met, a new state is generated, the cumulative cost g(v) is calculated, the number of wavelength changes is incremented by 1, and the remaining capacity of the converter conv_rem(v) is decremented by 1.
[0179] During each state expansion, the above hard constraints a to c must be satisfied simultaneously.
[0180] Termination condition 1: When a state s=(t,λ,sw,osnr_budget) in the priority queue reaches the destination node t, the path and wavelength sequence from the initial state to s constitute a feasible candidate optical path, and it is added to the result list.
[0181] Termination condition two: When K feasible candidate optical paths have been collected in the result list (K is 3 to 5 in the example), or when the priority queue is empty, the search stops.
[0182] Output K candidate optical paths, each represented as (P, Λ), where P=(v_0=s,v_1,...,v_L=t) is the node sequence on the path, and Λ=(λ_0,λ_1,...,λ_{L-1}) is the wavelength sequence used on each link segment.
[0183] In this embodiment of the invention, after obtaining the TOP-K candidate optical paths, resource updates are performed:
[0184] After selecting one optical path from K candidate optical paths for actual allocation (the selection strategy can be determined by the upper-layer strategy module, such as selecting the optical path with the shortest distance, optimal OSNR, or fewest wavelet switching), update the network resource status:
[0185] Update link wavelength occupancy status: For each link e and each wavelength λ used by the optical path, execute λ_mask(e)[λ]=0 to mark it as occupied;
[0186] Update converter node capacity: For each node v in the optical path that performs wavelength conversion, execute conv_rem(v)=conv_rem(v)-1;
[0187] Record OSNR-related parameters: Record the actual end-to-end OSNR of this optical path for subsequent service evaluation or network optimization.
[0188] When a new business request arrives, repeat steps S101 to S105 above and update the resources again.
[0189] In this embodiment of the invention, the request conditional graph neural network model adopts... (GraphSampling and Aggregating) or Graph Attention Network (GAT), and achieves training and inference on large-scale graphs through neighbor sampling, such as sampling 10~20 neighbors per layer; batch sampling is performed according to business requests.
[0190] For example, refer to Figure 3 As shown, the request-conditionalized graph neural network model is a "edge cost score + wavelength preference score" model based on graph neural networks (GNNs). It constructs a graph structure from network topology, link / edge attributes, wavelength occupancy, and service requests. Then, the GNN is used for message passing and node / edge representation learning. Finally, two output heads predict the edge cost score for each link and the wavelength preference score for each node, respectively. The model structure includes an input layer, a feature encoding layer, a GNN backbone network (message passing), and an output layer. Wherein:
[0191] 1. The input layer receives network and service request information, which mainly consists of the following parts:
[0192] (1) Node characteristics For each node in the network, it includes: whether it is a converter / conversion node conversion capacity percentage, in-degree, and out-degree; the dimension is denoted as N×dv, where N is the number of nodes and dv is the node feature dimension, which can be set to 16 or 32.
[0193] (2) Edge / Link Characteristics This corresponds to a link or physical connection in the network, including: link length, propagation loss, and link delay. The dimension is denoted as E×de, where E is the number of edges.
[0194] (3) State representation of directed graph: Wavelength occupancy mask Me, used to represent the usage of wavelength resources. The figure shows an occupancy matrix, indicating whether each wavelength, each link, or each resource dimension is occupied, which wavelengths are occupied, and which are still available. The dimension is roughly E×W or similar, where W is the number of wavelengths.
[0195] (4) Business request information q, representing the business requirements that need to be served, such as the source node, destination node (target node), and the source-destination distance encoded as request features. The business request will be encoded into a vector q, which will be used for subsequent fusion with conditions into the graph node / edge representation.
[0196] 2. Feature Encoding Layer: The raw input is generally not directly fed into the GNN. Instead, it is first encoded into a uniform-dimensional embedding vector using an MLP. Specifically, node features are mapped to node embeddings (hv) through the MLP, edge features are mapped to edge embeddings (he), wavelength occupancy is mapped to wavelength-related embeddings (Hw), and service requests are mapped to service request vectors (q). The goal is to project heterogeneous information, such as topology, physical link attributes, wavelength resources, and service requirements, into the same latent space or a fusionable representation space.
[0197] 3. GNN Backbone Network: Its core is a graph neural network, which can use GraphSAGE or GAT structures. GNNs perform multi-layer message passing across the network topology.
[0198] Neighbor information is aggregated progressively at layers k=1, k=2, ..., k=L.
[0199] Each node receives information from its neighboring nodes and adjacent edges;
[0200] After multiple layers of propagation, the node representation contains increasingly larger local topological contexts.
[0201] In this model, node representation updates are jointly determined by the representation of its parent node, neighboring node representations, and edge representations. Furthermore, "conditional fusion" incorporates the business request vector q during edge / node updates. This means the model doesn't just learn static network representations, but dynamically adjusts node / edge representations based on the "current business request." For example, the same link might have different "quality" depending on different source-destination pairs and different bandwidth requirements.
[0202] 4. Output Layer: The model has two output heads, including an edge cost scoring head and a wavelength preference scoring head. Wherein:
[0203] (1) Edge Cost Score Header: This header outputs the cost of each edge. The input is the edge / node-edge related representation processed by the GNN, which is then processed by the MLP to obtain the edge cost score, with a dimension of E×1. The higher the edge cost, the less suitable the edge is for the current business request. This can be used for edge weighting, pruning, ranking, or reinforcement learning policy network output in path search.
[0204] (2) Wavelength Preference Scoring Header: This header outputs the preference score for each wavelength from each converter node. The input includes wavelength-related embeddings and request / node context information. The score for each wavelength is obtained through an MLP, with the following dimensions: This indicates the suitability of each candidate wavelength under the current network conditions and service requests. A high wavelength preference score means that the wavelength is more suitable for allocation to the current service; a low wavelength preference score may indicate more collisions, a higher probability of blocking, and greater costs such as distance / crosstalk / congestion.
[0205] In this embodiment of the invention, the aforementioned request-conditionalized graph neural network model is obtained by training the graph neural network through candidate ranking under the condition of historical data without optimal labels, so that it gradually approximates the optimization preference of the multi-objective function and reduces ineffective expansion. Specifically, it includes:
[0206] S201: Obtain the training sample set, wherein each training sample includes the service requests at historical moments and the corresponding network status;
[0207] S202: For each training sample, construct a directed graph based on the network state, construct node feature vectors and edge feature vectors, and construct a request vector based on the business request.
[0208] S203: Use traditional search path algorithms to generate multiple candidate paths and perform constraint filtering to obtain a set of feasible candidate optical paths;
[0209] S204: For each feasible candidate optical path in the set of feasible candidate optical paths for each training sample, calculate the comprehensive score based on the multi-objective comprehensive scoring function;
[0210] S205: Sort the feasible candidate optical paths according to the comprehensive score of each training sample, and label the top n% of optical paths as positive samples and negative samples.
[0211] S206: Construct a set of preference pairs based on all positive and negative samples;
[0212] S207: Based on the directed graph, node feature vector, edge feature vector and request vector of each training sample, perform forward computation on the input request conditional graph neural network model to be trained to obtain the edge cost score of each link and the wavelength preference score of each converter node.
[0213] S208: For each feasible candidate optical path, the model prediction score is calculated based on the preset model prediction score function;
[0214] S209: For each preference pair, predict the score based on the corresponding model, minimize the pairwise ranking loss, and adjust the model parameters through backpropagation;
[0215] S210: Repeat the model training process until the preset conditions are met to obtain the requested conditional graph neural network model.
[0216] In this embodiment of the invention, the training samples in step S201 are defined as follows: Let i be the time i. This represents the network state at time i, including information such as the wavelength occupancy status of all links at time i and the remaining capacity of all converter nodes. This is the business request at this time.
[0217] In this embodiment of the invention, the specific implementation process of step S202 can be referred to the detailed description of the implementation process of steps S102 to S104, and will not be repeated here.
[0218] In this embodiment of the invention, the traditional search path algorithm used in step S203 can be at least one existing search path algorithm, such as KSP (K shortest paths), A*, etc. For each request... There are m candidate solutions, where This is the m-th candidate solution for the i-th request. The set of candidate solutions for the i-th request.
[0219] Then, constraint filtering is performed. Specifically, constraint filtering is applied to multiple candidate paths generated using traditional search path algorithms for each training sample, including:
[0220] Wavelength availability check: Checks whether there are available wavelengths on each link of the candidate path;
[0221] Converter validity check: Check whether the wave-changing point in the candidate path is a converter node;
[0222] Converter capacity verification checks whether the remaining capacity of the converter nodes in the candidate path meets the wave switching requirements.
[0223] OSNR threshold verification checks whether the end-to-end OSNR in the candidate path meets the preset threshold requirements.
[0224] In one specific embodiment, the multi-objective comprehensive scoring function issued in step S204 above is as follows:
[0225]
[0226] in, This represents the total cost of the path. This indicates the number of wave switching events that occur in the candidate path. This represents the set of nodes where wave switching occurs. The function represents the converter stress penalty function, where α is the path length penalty coefficient, controlling how important "short path" is, β is the wave switching penalty coefficient, controlling how important "minimize wave switching" is, and β2 is the converter capacity penalty coefficient, controlling how important "avoid stressful converters" is.
[0227] The smaller the value of J(l), the better the optical path l is. If a candidate is not feasible, J(l) can be directly defined as +∞.
[0228] In this embodiment of the invention, the converter stress penalty function can be:
[0229] This means that the smaller the remaining capacity r, the greater the penalty; or,
[0230] A threshold-based converter stress penalty function is used:
[0231] This indicates that a large penalty is applied when the converter is almost full.
[0232] In this embodiment of the invention, in step S205 above, it is assumed that the value of n is 30. Sort the data, with the top 30% considered excellent and the bottom 30% considered non-compliant (the more excellent the data, the lower the score, i.e., the lower the cost).
[0233] .
[0234] In this embodiment of the invention, in step S206 above, a set of preference pairs is constructed based on all positive and negative samples. For each preference pair:
[0235] .
[0236] In the embodiment of the present invention, in the above step S207, forward calculation is performed on the sample( ) once to obtain all edge costs and all converter node wavelength preferences. For the specific implementation manner of calculating the edge cost score and the wavelength preference score, reference may be made to the detailed description of the above step S104, which will not be repeated herein.
[0237] In the embodiment of the present invention, in the above step S208, the model prediction scoring function:
[0238]
[0239] In the embodiment of the present invention, in the above step S209, the Pairwise ranking loss function is:
[0240] .
[0241] The pairwise ranking loss is adopted, and if J(lp_a)<J(lp_b), the loss function L is minimized.
[0242] In the embodiment of the present invention, the request conditioning mechanism of the request-conditioned graph neural network model is configured to fuse the request vector with the node / edge representations. In the embodiment of the present invention, the request conditioning mechanism is configured to integrate current service request information into the node and edge representations of the graph neural network, so that the model can generate different path evaluation results according to different source-destination node requests. Specifically, first, the request vector q is constructed according to the features of the source node and the destination node of the service request and the encoding of the source-destination distance; then, after the graph neural network completes message propagation, the request vector q is concatenated with the node representation and the edge representation respectively, and nonlinear mapping is performed through a multi-layer perceptron:
[0243] H'v=MLP([hv||q])
[0244] H'e=MLP([he||q])
[0245] The edge cost score and the wavelength preference score are calculated based on the fused node representation and edge representation, so that the output result reflects both the network resource state and the current service request requirement.
[0246] In the embodiment of the present invention, the message passing mechanism of the request-conditioned graph neural network model.
[0247] In this embodiment of the invention, the model network can be set to an MLP with 2 layers and a hidden dimension of 128, or a GNN with 2-3 layers and an encoding dimension of 16 or 32. During model training, the Adam optimizer can be used, with an initial learning rate set, such as 0.001, and a learning rate decay strategy. The gradient of the loss function L is calculated, and the GNN model parameters, including encoder parameters, GNN backbone network parameters, edge cost header parameters, and wavelength preference header parameters, are updated through backpropagation. Training iterations are repeated multiple times according to batch size (32-64), for example, 100-200 epochs, until the loss value converges or the preset number of iterations is reached.
[0248] To provide a clearer and more complete explanation of the path and wavelength joint allocation method for WSON provided in this embodiment of the invention, taking a wavelength division multiplexing optical network (WSON) as an example, the network includes 1000 nodes (v), 100000 links (e), each link supports 96 wavelengths W, some nodes have wavelength conversion capabilities (converter nodes), and each converter node has a limited conversion capacity of 96 by default, the path and wavelength joint allocation method for WSON provided in this embodiment of the invention will be described in detail below:
[0249] The network parameters are set as follows: the number of nodes N is 1000; the number of links is approximately 100,000; the number of wavelengths W is 96; the proportion of converter nodes is approximately 10% to 20% (100 to 200 nodes); the default capacity of each converter node is 96 (the same as the number of wavelengths).
[0250] The specific execution process is divided into two stages:
[0251] First, the graph neural network model is trained offline, enabling it to generate high-quality edge cost scores and wavelength preference scores based on network conditions and business requests. This stage utilizes historical business data and employs a ranking learning method without optimal labels to train the model, resulting in a well-trained request-conditional graph neural network model.
[0252] Secondly, the online inference phase is a real-time process executed each time a service request arrives, utilizing a trained GNN model to calculate feasible optical paths for the current service request. This phase first generates heuristic costs related to the current request and network state through the GNN, and then performs a constrained Top-K search in the augmented state space, rigorously checking for wavelength conflicts, converter capacity, and OSNR hard constraints, outputting K feasible candidate optical paths.
[0253] The model parameters are set as follows: wavelength mask encoding dimension d is 16 (lightweight mode) or 32 (precision mode); MLP encoder has 2 layers and hidden layer dimension is 128; GNN has 2 to 3 layers; neighbor sampling number is 10 to 20 neighbors sampled by each node during training; edge cost head is 2 layers of MLP and hidden layer dimension is 64; wavelength preference head is a linear layer and output dimension is W=96.
[0254] The search parameters are set as follows: Top-K candidate optical path number K is 3; Top-M candidate wavelength number M is 3; heuristic adjustment coefficient. Take 1.0.
[0255] The training parameters are set as follows: the optimizer is Adam; the initial learning rate is 0.001 with a decay strategy; the batch size is 32 to 64 requests; and the number of training epochs is 100 to 200.
[0256] The model training process described in steps S201-S210 includes the following:
[0257] For historical service requests and corresponding network status, existing naive search path algorithms, such as KSP (K shortest paths) and A*, are first used to generate multiple sets of feasible candidate optical paths. Then, constraint filtering is performed, including wavelength availability, converter validity, availability of remaining converter capacity, and satisfaction of OSNR threshold, to obtain available paths.
[0258] Here we define each training sample as... i represents the i-th time.
[0259] For each request There are m candidate solutions, where This is the m-th candidate solution for the i-th request. The set of candidate solutions for the i-th request. , The network state at time i. This is the request at this time.
[0260] Build for each link e .calculate This is used to calculate the proportion of currently available wavelengths on link e to the total number of wavelengths. z_λ(e) = enc(λ_mask(e)), where the encoder output dimension d is 32. The edge feature vector is obtained as follows:
[0261]
[0262] Based on the remaining capacity of each converter node , / 96 represents the normalized value of the converter's remaining capacity. , in_deg is the in-degree, and out_deg is the out-degree. The node feature vector is obtained as:
[0263]
[0264] For historical service requests and their corresponding network states, a plurality of feasible candidate optical paths are first generated and defined as .
[0265] For each feasible candidate optical path, a comprehensive score is calculated based on the above multi-objective comprehensive scoring function ; are sorted, the top 30% are regarded as excellent (positive samples), and the bottom 30% are regarded as non-conforming (negative samples). Here, the more excellent the path is, the lower the score, that is, the smaller the cost. A set of preference pairs is constructed.
[0266] Each preference pair:
[0267]
[0268] Next, the request-conditioned graph neural network is trained without optimal labels (learning to rank):
[0269] According to the directed graph, node feature vector, edge feature vector and request vector of each training sample, forward calculation is performed on the to-be-trained input request-conditioned graph neural network model, to obtain the edge cost score of each link and the wavelength preference score of each converter node:
[0270] Wherein the edge cost head (Head A) of the model is:
[0271]
[0272] Wherein the wavelength preference head (Head B) of the model is:
[0273]
[0274] For each feasible candidate optical path, based on the preset model prediction scoring function , the model prediction score is calculated;
[0275] S209: For each preference pair J(lp_a)<J(lp_b), the Pairwise ranking loss is minimized according to the corresponding model prediction score , and the model parameters are adjusted through back propagation;
[0276] The model training process is repeatedly executed until the iteration reaches a preset condition, so as to obtain the request-conditioned graph neural network model.
[0277] Upon receiving a service request to be allocated from the wavelength division multiplexing optical network, steps S101 to S106 are executed to construct a directed graph G, node feature vectors, edge feature vectors, and the request vector as input to a request-conditional graph neural network model. This yields the edge cost score for each link and the wavelength preference score for each converter node, and a Top-K search is performed under constraints.
[0278] Define the augmented state(s) = (v, λ, sw, osnr_budget) in the augmented state space.
[0279] The constraints include that the same wavelength on the same link cannot be repeatedly occupied by multiple services;
[0280] The wavelength can only be changed at nodes with wavelength conversion capabilities, and each wavelength conversion consumes the wavelength converter capacity of that node.
[0281] The end-to-end OSNR of the candidate optical path meets the preset hard threshold.
[0282] The extended rules include non-wavelength extended rules and wavelength extended rules:
[0283] No-wavelength expansion rule: along the outgoing edge e=(v→u), λ_mask(e)[λ]=1 and the OSNR budget is not less than 0 after the update;
[0284] Wavelet switching expansion rules: λ→λ′ is allowed only when is_converter(v)=1 and conv_rem(v)>0; the top-M λ′ are selected and the next edge is hard-masked and filtered; each wavelet switching consumes 1 unit of conversion capacity and increases the wavelet switching penalty.
[0285] Taking A* as an example, the expansion cost is:
[0286] ;
[0287] Heuristic Costs:
[0288] ;
[0289] The cumulative cost is:
[0290] f(u) = g(u) + h(u);
[0291] Based on the ascending order of the cumulative cost f(u), K feasible candidate optical paths are finally output.
[0292] After selecting one of the K candidate optical paths for actual allocation, update the network resource status:
[0293] Update link wavelength occupancy status: Mark each link e and each wavelength λ used by the optical path as occupied;
[0294] Update converter node capacity: For each node v in the optical path that performs wavelength conversion, execute conv_rem(v)=conv_rem(v)-1;
[0295] Record OSNR-related parameters: Record the actual end-to-end OSNR of this optical path.
[0296] Regarding the path and wavelength joint allocation method and selection Heuristic-A* for WSON provided by the invention:
[0297] Heuristic function: h(u) = α·dist_shortest(u,t), where α = 1.0
[0298] Edge cost: fixed as link length
[0299] Wavelength selection: First-Fit
[0300] It lacks GNN guidance and a learning mechanism.
[0301] Based on the performance comparison between the path and wavelength joint allocation method for WSON provided by this invention and the traditional Heuristic-A algorithm, the average throughput varies greatly under different network node sizes, indicating that the proposed method has a significant performance improvement over the traditional Heuristic-A method under different network sizes.
[0302] Example 2
[0303] Based on the same inventive concept, embodiments of the present invention also provide a path and wavelength joint allocation device for WSON, referring to... Figure 4 As shown, it includes:
[0304] The first construction module 101 is used to model the current WSON network as a directed graph; where in the directed graph G=(V,E), V is the set of nodes and E is the set of directed links;
[0305] The second construction module 102 is used to construct a wavelength availability state mask vector for each link in the link set based on whether the wavelength has been occupied, and obtain the corresponding low-dimensional vector, the proportion of the number of currently available wavelengths to the total number of wavelengths, and the normalized value of the physical length, and then concatenate them to obtain the edge feature vector.
[0306] The third construction module 103 is used to construct a node feature vector for each node in the node set based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node.
[0307] The fourth construction module 104 is used to obtain the current business request to be allocated, and construct a request vector based on the initial embedding and distance encoding of the source node and the destination node in the business request;
[0308] The model evaluation module 105 is used to input the directed graph, node feature vectors, edge feature vectors and the request vector into the request conditional graph neural network model to obtain the edge cost score of each link and the wavelength preference score of each node.
[0309] The enhancement search module 106 is used to perform optical path search in the enhancement state space according to the enhancement state and preset hard constraints, based on a pre-constructed cumulative cost function including expansion cost and heuristic cost, to obtain K candidate optical paths. Each optical path includes a path and a wavelength sequence. The enhancement state includes at least the current node and the current wavelength sequence. The expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term, and only the Top-M candidate wavelengths are expanded at the wavelength switching node based on the wavelength preference score. The heuristic cost includes the estimated residual cost from the current node to the target node.
[0310] Example 3
[0311] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the path and wavelength joint allocation method for WSON as described in Embodiment 1.
[0312] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires; a portable computer disk drive; a hard disk drive; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM); a register; a hard disk drive; an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0313] Example 4
[0314] Based on the same inventive concept, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the path and wavelength joint allocation method for WSON as described in Embodiment 1.
[0315] Figure 5 A possible structural diagram of the computer device involved in the above embodiments is shown. The computer device includes a processor 1002 and a communication interface 1003. The processor 1002 is used to control and manage the operation of the computer device, for example, executing the alarm association method described above, and / or other processes of the technology described herein. The communication interface 1003 is used to support communication between the computer device and other network entities, for example, executing the steps performed by the communication unit 902 described above. The computer device may also include a memory 1001 and a bus 1004, the memory 1001 being used to store the program code and data of the computer device.
[0316] The memory 1001 may be a memory in a computer device, and the memory may include: volatile memory, such as random access memory; the memory may also include: non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include: a combination of the above types of memory.
[0317] The processor 1002 described above can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0318] Bus 1004 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1004 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0319] Example 5
[0320] Based on the same inventive concept, embodiments of the present invention also provide a computer program product containing instructions that, when the computer program product is run on a computer device, cause the computer device to execute the path and wavelength joint allocation method for WSON as described in Embodiment 1.
[0321] The principles by which the above-mentioned devices, media, and related products in the embodiments of the present invention solve the problem are similar to those of the aforementioned methods. Therefore, their implementation can refer to the implementation of the aforementioned methods, and repeated details will not be repeated.
[0322] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0323] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0324] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0325] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0326] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A path and wavelength joint allocation method for WSON, characterized in that, include: The current WSON network is modeled as a directed graph; where in the directed graph G=(V,E), V is the set of nodes and E is the set of directed links; For each link in the link set, construct a wavelength availability state mask vector based on whether the wavelength is occupied, and obtain the corresponding low-dimensional vector, the proportion of the current available wavelengths to the total number of wavelengths, and the normalized value of the physical length. Concatenate these to obtain the edge feature vector. For each node in the node set, construct a node feature vector based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node. Obtain the currently pending business requests, and construct a request vector based on the initial embeddings and distance encodings of the source and destination nodes in the business requests; The directed graph, node feature vectors, edge feature vectors, and request vectors are input into the request conditional graph neural network model to obtain the edge cost score for each link and the wavelength preference score for each node. Based on the enhanced state in the enhanced state space, and according to preset hard constraints, an optical path search is performed in the enhanced state space based on a pre-constructed cumulative cost function including expansion cost and heuristic cost to obtain K candidate optical paths. Each optical path includes a path and a wavelength sequence. The enhanced state includes at least the current node and the current wavelength sequence. The expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term. Based on the wavelength preference score, only the Top-M candidate wavelengths are expanded at the wavelength switching node. The heuristic cost includes the estimated remaining cost from the current node to the target node.
2. The method as described in claim 1, characterized in that, When performing optical path search in the enhanced state space, state extension is performed based on the following non-wavelength extension rule and wavelength extension rule: No-wavelength expansion rule: For each outgoing link from the current node v, perform the following checks: Determine that the current wavelength on the current link is available, and calculate that the updated OSNR budget after passing through the current link is not less than 0; If the above no-wavelength expansion rule check conditions are met, generate a new state and calculate the cumulative cost. Wavelength switching extension rules: Wavelength switching is allowed only when the current node is a converter node and the remaining capacity of the converter is greater than 0. If the wavelength switching extension rules are met, the following steps are executed: Obtain the wavelength preference score for the current node; Select the Top-M candidate wavelengths based on wavelength preference scores; For each candidate wavelength, the non-wavelength expansion rule check is performed. If the non-wavelength expansion rule check conditions are met, a new state is generated, the cumulative cost is calculated, the number of wavelength changes is incremented by 1, and the remaining capacity of the converter is decremented by 1.
3. The method as described in claim 1, characterized in that, The preset hard constraints include: The same wavelength on the same link cannot be repeatedly occupied by multiple services; The wavelength can only be changed at nodes with wavelength conversion capabilities, and each wavelength conversion consumes the wavelength converter capacity of that node. The end-to-end OSNR of the candidate optical path meets the preset hard threshold.
4. The method as described in claim 1, characterized in that, The edge cost score is calculated based on the following edge cost score calculation formula: = , in, and Here, e represents the endpoint node embedding of the graph neural network output. Let q be the original feature of the edge itself, q be the request vector, and f(·) be the edge cost head network.
5. The method as described in claim 9, characterized in that, The wavelength preference score is calculated based on the following formula: ,in , belong , where is the learnable embedding vector for the λ-th wavelength.
6. The method as described in claim 1, characterized in that, The request-conditionalized graph neural network model is trained in the following manner: Obtain a training sample set, where each training sample includes historical business requests and corresponding network states; For each training sample, a directed graph is constructed based on the network state, node feature vectors and edge feature vectors are constructed, and a request vector is constructed based on the business request. Multiple candidate paths are generated using traditional search path algorithms, and constraint filtering is performed to obtain a set of feasible candidate optical paths. For each feasible candidate optical path in the set of feasible candidate optical paths for each training sample, a comprehensive score is calculated based on the multi-objective comprehensive scoring function; The feasible candidate optical paths for each training sample are sorted according to their comprehensive scores, and the top n% of optical paths are labeled as positive and negative samples. Construct a set of preference pairs based on all positive and negative samples; Based on the directed graph, node feature vector, edge feature vector, and request vector of each training sample, forward computation is performed on the input request conditional graph neural network model to be trained to obtain the edge cost score of each link and the wavelength preference score of each converter node. For each feasible candidate optical path, a model prediction score is calculated based on a preset model prediction scoring function; For each preference pair, predict the score based on the corresponding model, minimize the pairwise ranking loss, and adjust the model parameters through backpropagation. The model training process is repeated until the preset conditions are met, thus obtaining the requested conditional graph neural network model.
7. A path and wavelength joint allocation device for WSON, characterized in that, include: The first building block is used to model the current WSON network as a directed graph; The second construction module is used to construct a wavelength availability status mask vector for each link in the link set based on whether the wavelength has been occupied, and obtain the corresponding low-dimensional vector, the proportion of the number of currently available wavelengths to the total number of wavelengths, and the normalized value of the physical length, and then concatenate them to obtain the edge feature vector. The third construction module is used to construct a node feature vector for each node in the node set based on whether the node is a converter node, the normalized value of the remaining capacity of the converter, and the in-degree and out-degree of the node. The fourth construction module is used to obtain the currently unassigned business requests and construct a request vector based on the initial embedding and distance encoding of the source and destination nodes in the business requests. The model evaluation module is used to input the directed graph, node feature vectors, edge feature vectors and the request vector into the request conditional graph neural network model to obtain the edge cost score of each link and the wavelength preference score of each node. An enhanced search module is used to perform optical path search in the enhanced state space according to the enhanced state space and preset hard constraints, based on a pre-constructed cumulative cost function including expansion cost and heuristic cost, to obtain K candidate optical paths. Each optical path includes a path and a wavelength sequence. The enhanced state includes at least the current node and the current wavelength sequence. The expansion cost includes at least a learning cost term guided by the edge cost score and a wavelength switching penalty term, and expands only the Top-M candidate wavelengths at the wavelength switching node based on the wavelength preference score. The heuristic cost includes the estimated residual cost from the current node to the target node.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the path and wavelength joint allocation method for WSON as described in any one of claims 1-6.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the path and wavelength joint allocation method for WSON as described in any one of claims 1-6.
10. A computer program product comprising instructions that, when executed on a computer device, causes the computer device to perform the path and wavelength joint allocation method for WSON as described in any one of claims 1-6.
