A method for determining a flight string node sequence
By building a fully connected graph and deep learning model, multiple starting nodes are randomly selected, candidate node sequences are generated and resource requirements are optimized, the problems of resource waste and delays in flight plans are solved, and more accurate and economical flight schedules are achieved.
Patent Information
- Application Number
- CN202510503907.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-22
AI Technical Summary
The prior art is difficult to effectively reduce resource use and prevent flight delays in flight planning scheduling, and traditional methods may cause algorithms to fall into local optimal solutions and lack global optimal strategies.
The model is determined based on the trained node sequence, and by constructing a fully connected graph, multiple starting nodes are randomly selected, node embedding features are extracted, candidate node sequence sets are generated, and the sequence with the smallest total resource demand value is selected as the target node sequence. Taking into account the time-space connection and model constraints between flights, deep learning methods are used to optimize flight string orchestration.
It improves the accuracy and applicability of flight node sequences, reduces flight delay time and cost, enhances the robustness and solution efficiency of the model, and the generated flight plan is more in line with practical application scenarios.
Smart Images

Figure CN120031699B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology applications, and particularly to a method for determining a flight string node sequence. Background Art
[0002] In some application scenarios, it is necessary to specify an execution object for a to-be-processed event so that the to-be-processed event can be smoothly executed. For example, for a to-be-processed aircraft flight plan, it is necessary to allocate a suitable aircraft for each flight so that the flight plan can be smoothly realized to the greatest extent. For the scheduling problem of flight plans, there are already many solutions at present. The present invention strives to provide another solution that can minimize the use of resources and prevent congenital flight delays. Summary of the Invention
[0003] For the above technical problems, the technical solution adopted by the present invention is as follows:
[0004] An embodiment of the present invention provides a method for determining a flight string node sequence. The method is implemented based on a trained node sequence determination model. The trained node sequence determination model includes a starting node selection module, a node embedding feature extraction module, and a target node acquisition module. The method includes the following steps:
[0005] S100, construct a fully connected graph based on the current to-be-processed event set; a to-be-processed event in the current to-be-processed event set represents a flight. The fully connected graph is an undirected graph with self-connections. The nodes in the fully connected graph represent to-be-processed events, and any two nodes are connected by an undirected edge.
[0006] S200, input the fully connected graph into the starting node selection module to randomly select kc nodes from all the nodes in the fully connected graph as starting nodes and input them to the target node acquisition module; kc > 1.
[0007] S300, input the fully connected graph into the node embedding feature extraction module to extract the node embedding features of all the nodes in the fully connected graph, and input the extracted node embedding features to the target node acquisition module.
[0008] S400, for each starting node, use the target node acquisition module to obtain a node sequence set corresponding to each starting node as a candidate node sequence set, and obtain k candidate node sequence sets; each candidate node sequence in the candidate node sequence set is executed by the same execution object.
[0009] S500, obtain the total resource requirement value corresponding to each candidate node sequence set, obtain k total resource requirement values, and use the candidate node sequence set corresponding to the minimum value among the k total resource requirement values as the target node sequence set of the current to-be-processed event.
[0010] The present invention has at least the following beneficial effects:
[0011] The method for determining a flight string node sequence provided by an embodiment of the present invention is implemented based on a trained node sequence determination model. The trained node sequence determination model includes a starting node selection module, a node embedding feature extraction module, and a target node acquisition module. The method includes: constructing a fully connected graph based on a currently to-be-processed event; inputting the fully connected graph into the starting node selection module to randomly select k nodes from all nodes in the fully connected graph as starting nodes and input them to the target node acquisition module; inputting the fully connected graph into the node embedding feature extraction module to extract the node embedding features of all nodes in the fully connected graph and input the extracted node embedding features to the target node acquisition module; for each starting node, using the target node acquisition module to obtain a node sequence set corresponding to each starting node as a candidate node sequence set, obtaining k candidate node sequence sets; obtaining the total resource demand value corresponding to each candidate node sequence set, obtaining k total resource demand values, and using the candidate node sequence set corresponding to the minimum value among the k total resource demand values as the target node sequence set of the currently to-be-processed event. Since the present invention is based on multiple randomly generated starting nodes when obtaining the node sequence, it can enable the agent to repeatedly solve the same problem from different entry points, come into contact with various problem-solving techniques, and thus be able to obtain a more accurate node sequence. In addition, selecting the node sequence with the smallest total resource demand value as the target node sequence can make the obtained node sequence more in line with the actual application scenario and have strong applicability.
[0012] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0014] Figure 1 It is a flowchart of the method for determining a flight string node sequence provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0015] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0016] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this invention belongs. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0017] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0018] A method for determining a flight string node sequence provided by an embodiment of the present invention is implemented based on a trained node sequence determination model, and the trained node sequence determination model includes a starting node selection module, a node embedding feature extraction module, and a target node acquisition module.
[0019] As shown in Figure 1, the method includes the following steps:
[0020] S100, based on the current event set to be processed, construct a fully connected graph.
[0021] In the embodiment of the present invention, the fully connected graph is an undirected graph with self-connections. The nodes in the fully connected graph represent events to be processed, and any two nodes are connected by an undirected edge. An event to be processed in the current event set to be processed represents a flight that needs to be executed, that is, the entire fully connected graph represents a flight plan. The feature of the node is the flight feature. The flight feature includes the aircraft type allowed for the flight, the planned departure time, the planned arrival time, the planned departure airport, and the planned arrival airport.
[0022] S200, input the fully connected graph into the starting node selection module to randomly select k nodes from all the nodes in the fully connected graph as starting nodes and input them to the target node acquisition module; kc > 1.
[0023] In an embodiment of the present invention, kc may be an empirical value. For example, kc = [N×f], where N is the number of nodes in the fully connected graph, f is a preset coefficient, and [ ] represents rounding. In a schematic embodiment, f = 0.1.
[0024] In the aircraft scheduling problem, the selection of the starting node is very important. If the takeoff time of the selected flight node is relatively late, then the subsequent flights with earlier takeoff times cannot be executed. In the previous training method, the first node is always selected by the network. When there are repeated seemingly correct starting nodes, it will guide the model to tend to a specific starting point, which may lead to a biased strategy. The present invention draws on the idea of optimizing multiple optimal strategies, forcing the network to always generate multiple paths, and the starting points of all these paths are different. Conceptually, the exploration of optimizing multiple optimal strategies tends to guide the agent to repeatedly solve the same problem from different entry points, enabling it to come into contact with various problem-solving techniques.
[0025] S300, input the fully connected graph into the node embedding feature extraction module to extract the node embedding features of all nodes in the fully connected graph, and input the extracted node embedding features to the target node acquisition module.
[0026] In an embodiment of the present invention, the purpose of the node embedding feature extraction module is to reflect the state of the flight plan of the current event set to be processed, so that the agent can understand the features of each flight node.
[0027] In an embodiment of the present invention, the node embedding feature extraction module may include: a node embedding module, and M encoding modules connected in sequence. Each encoding module includes a multi-head self-attention layer, a first splicing processing module, a feed-forward neural network layer, and a second splicing processing module connected in sequence. The node embedding module is respectively connected to the multi-head self-attention layer and the first splicing processing of the first encoding module. The first splicing processing module of each encoding module is also connected to the corresponding second splicing processing module. The second splicing processing module of the previous encoding module in two adjacent encoding modules is respectively connected to the multi-head self-attention layer and the first splicing processing module of the subsequent encoding module. The second splicing processing module of the Mth encoding module is connected to the target node acquisition module. The first splicing processing module and the second splicing processing module are both used for: splicing the received input features to obtain the corresponding splicing result, and performing affine transformation batch normalization processing on the splicing result, where M > 1.
[0028] In an embodiment of the present invention, M may be an empirical value. In a schematic embodiment, M = 6.
[0029] In an embodiment of the present invention, the node embedding module is specifically used for:
[0030] First, convert the three-letter codes of the departure airport and arrival airport of the flight into numbers in alphabetical order. For example, since C ranks third in the alphabet, C can be converted to 03, so CAN can be converted to 030114. Map the required aircraft type of the flight to a number: for example, map to 0, map to 1. Convert both the scheduled departure time and the scheduled arrival time of the flight into timestamps.
[0031] Next, perform min-max normalization on all features to obtain the normalized features.
[0032] Then, project each node into a space with a dimension of d h to obtain the initial node embedding. In the embodiment of the present invention, d h = 128 dimensions. The initial node embedding h0 of each node is h0 = W0 × X + b0, where W0 and b0 are learnable parameter matrices respectively, and X is the normalized feature of the node.
[0033] In the embodiment of the present invention, the number of attention heads in the multi-head attention layer can be set according to actual needs. In a schematic embodiment, the number of attention heads can be 8.
[0034] In the embodiment of the present invention, each attention head is used to calculate the attention value of each node. The query vector q of each node is q = W Q h, the key vector k is k = W K h, and the value vector v is v = W V h. h is the node embedding of the node, and W Q and W K are parameter matrices with a dimension size of (d k × d h ), and W V is a parameter matrix with a dimension size of (d v × d h ). In a schematic embodiment, d k = d v = 16. Each attention head is specifically used to perform the operation:
[0035] Obtain the compatibility between node n1 and node n2, that is, the attention score. If node n1 and node n2 are adjacent, the attention score S(u1, u2) between node n1 and node n2 is S(u1, u2) = q n1 k n2 T / (d k ) 1 / 2 , if node n1 and node n2 are not adjacent, the attention score between node n1 and node n2 is negative infinity. q n1 is the query vector of node n1, and k n2 is the key vector of node n2. The values of n1 and n2 range from 1 to N, and N is the number of nodes in the fully connected graph.
[0036] Obtain the attention weights W of nodes n1 and n2 n1n2 =e S(u1,u2) / ∑ N n3=1 e S(u1,u3) , S(u1, u3) is the attention score of nodes u1 and u3, the value of u3 ranges from 1 to N, and e is a natural number.
[0037] Obtain the attention value SP of node n1 n1 =∑ N n2=1 W n1n2 ×v n2 ; v n2 is the value vector of node n2.
[0038] In the embodiments of the present invention, a parameter matrix W with a dimension size of (d v ×d h ) is used m to project the attention values of each node obtained by all attention heads back to a d h -dimensional vector. That is, the multi-head attention value SM obtained by node n1 through the multi-head attention layer n1 =∑ M1 n4=1 W m ×SP n1n4 , the value of n4 ranges from 1 to M1. M1 is the number of attention heads.
[0039] In the embodiments of the present invention, the specific working principle of the splicing module can be the prior art. An affine parameter matrix with a dimension size of d h is used in the affine transformation batch normalization process.
[0040] In the embodiments of the present invention, the feed-forward neural network layer can be calculated using a hidden sub-layer with a dimension d f = 512 and a ReLu activation function, and the specific calculation process can be the prior art.
[0041] S400. For each starting node, use the target node acquisition module to obtain the node sequence set corresponding to each starting node as the candidate node sequence set, and obtain k candidate node sequence sets and send them to the target node sequence acquisition module; wherein, each candidate node sequence in the candidate node sequence set is executed by the same execution object, and the execution object is an aircraft.
[0042] In an embodiment of the present invention, the target node acquisition module is used to parse the relationships between flight nodes through the flight node features extracted by the node embedding feature extraction module, and compile and output a flight string sequence, which may include a candidate node selection unit, a multi-head attention layer, a single-head attention layer, and a target node selection unit. The candidate node selection unit is used to screen flight nodes, and the attention layer is used to calculate the probabilities of flight nodes and select the next node of the flight sequence. At the same time, after node selection, the decoder needs to update the context embedding to ensure timely capture of new graph structure information.
[0043] Further, S400 specifically includes:
[0044] S401, set the starting node counter r = 1.
[0045] S402, if r ≤ k, set the execution object counter g = 1, and execute S403; if r > k, obtain k candidate node sequence sets, and execute S500.
[0046] S403, if the current node set is not empty, execute S404; otherwise, obtain the candidate node sequence set corresponding to the rth starting node, set r = r + 1, and execute S402; the initial value of the current node set is the node set formed by all nodes in the fully connected graph.
[0047] S404, use the candidate node selection unit to select a node from the current node set that satisfies the preset constraint condition with the currently selected node corresponding to the gth execution object. If a node that satisfies the preset constraint condition with the currently selected node corresponding to the gth execution object is obtained, use the obtained node that satisfies the preset constraint condition with the currently selected node corresponding to the gth execution object as the current candidate node of the gth execution object, and execute S405; if a node that satisfies the preset constraint condition with the currently selected node corresponding to the gth execution object is not obtained, execute S409; where the initial value of g is 1, and the initial value of the currently selected node corresponding to the 1st execution object is the rth starting node.
[0048] In an embodiment of the present invention, the preset constraint condition satisfies the following conditions:
[0049] If M j = 1, it means that the jth node in the current node set is a candidate node of the currently selected node; if M j = 0, it means that the jth node in the current node set is not a candidate node of the currently selected node, where M j is the total constraint value corresponding to the jth node, and M j = C j ⊙C jE ⊙C j L , C j is the transfer time constraint value corresponding to the j-th node, C j E is the aircraft type constraint value corresponding to the j-th node, C j E is the airport connection constraint value corresponding to the j-th node, C j Satisfy the following conditions: If the slack time between the currently selected node and the j-th node is greater than or equal to 0, C j = 1, otherwise, C j = 0; C j E Satisfy the following conditions: If the aircraft type corresponding to the currently selected node is applicable to the j-th node, C j E = 1, otherwise, C j E = 0; C j L Satisfy the following conditions: If the departure airport corresponding to the j-th node is the airport corresponding to the currently selected node, C j L = 1, otherwise, C j L = 0; ⊙ represents the exclusive NOR operation, and the value of j ranges from 1 to Q, where Q is the number of nodes in the current node set.
[0050] In an airline, aircraft scheduling is to arrange a series of flights to be executed for each aircraft, that is, a flight string, according to the flight schedule determined by market demand and under the conditions of meeting space-time connection, etc. Slack time refers to the extra time reserved during the actual execution of a flight to cope with possible delays and unexpected situations. The slack time between two flights is the difference between the planned layover time difference of the two flights and the minimum layover time. If there is not enough slack time between two flights, then the delay of the previous flight will affect the subsequent flight. Assuming that the minimum layover time is 30 minutes, the historical average delay time of flight Fa, 50 minutes, is greater than the slack time between flight Fa and flight Fc, 30 minutes, then it will increase the probability of delay of the subsequent flight string connected by flight Fa and flight Fc; the historical average delay time of flight Fb, 5 minutes, is less than the slack time between flight Fb and Fd, 30 minutes, it can be considered that the slack time between Fb and Fd can buffer the delay of the previous flight Fb. In a flight string with good robustness, flights Fa and Fd will be connected, and flights Fb and Fc will be connected. Eventually, by optimizing the flight string, the robustness of the flight plan can be improved.
[0051] S405. Based on the average of the node embedding features of all nodes in the fully connected graph, the node embedding feature of the currently selected node corresponding to the g-th execution object, and the number of currently used execution objects, use the multi-head attention layer to obtain the context attention feature corresponding to the fully connected graph as the current context attention feature corresponding to the g-th execution object.
[0052] S406. Based on the current context attention feature corresponding to the g-th execution object, use the single-head attention layer to obtain the node weight of each node in the fully connected graph as the current node weight corresponding to the g-th execution object.
[0053] S407. Based on the current node weight corresponding to the g-th execution object, use the target node selection unit to obtain the target node from the current candidate nodes of the g-th execution object as the current target node corresponding to the g-th execution object; wherein, the current target node corresponding to the g-th execution object is the node corresponding to the maximum node weight of the current node weight of the g-th execution object.
[0054] S408. Take the current target node corresponding to the g-th execution object as the currently selected node corresponding to the g-th execution object and add it to the currently selected node set corresponding to the g-th execution object, and delete the current target node from the current node set, then execute S403; the initial value of the currently selected node set corresponding to the g-th execution object is empty.
[0055] S409. Obtain the candidate node sequence corresponding to the g-th execution object based on the currently selected node set corresponding to the g-th execution object, set g = g + 1, and randomly select a node from the current node set as the initial value of the currently selected node corresponding to the (g + 1)-th execution object, then execute S403.
[0056] Further, in S405, using the multi-head attention layer to obtain the context attention feature corresponding to the fully connected graph specifically includes:
[0057] S4051. Obtain the current concatenated feature FP; where FP satisfies the following conditions: if the time step t = 1, FP = [F avg , z, P t , if t > 1, FP = [F avg , F t , P t , F avg is the average of the node embedding features of all nodes, z is a set input placeholder, P t is the number of currently used execution objects, and F t is the node embedding feature of the currently selected node.
[0058] S4052, using each attention head of the multi-head attention layer to obtain the attention score vector between the current context embedding feature and the node embedding features of all nodes in the fully connected graph; wherein the query vector q corresponding to the current context embedding feature c The following conditions are met: c =W Q ×FP,W Q is the query weight matrix of the attention head, and the key vector k corresponding to the a-th node in the fully connected graph a =W K ×h a , the value vector v corresponding to the a-th node a =W V ×h a , W K is the key weight matrix of the attention head, h a is the node embedding feature of the a-th node, W V is the value weight matrix of the attention head, where if the a-th node is not a candidate node, the attention score between the current context embedding feature and the node embedding feature of the a-th node is set to negative infinity; if the a-th node is not a candidate node, the attention score between the current context embedding feature and the node embedding feature of the a-th node is set to S(c, a)=q c k a T / (d k ) 1 / 2 , d k is the dimension of the key vector, a ranges from 1 to N, where N is the number of nodes in the fully connected graph.
[0059] S4053, based on the current context embedding feature obtained by each attention head and the attention score vector between all nodes in the fully connected graph, obtain the attention value Av=∑ N a=1 (e S(c,a) / ∑ N b1=1 e S(c ,b1) )×v a , S(c, b1) is the attention score between the current context embedding feature and the node embedding feature of the b1th node in the fully connected graph, b1 ranges from 1 to N, and e is a natural number.
[0060] S4064, based on the attention value of the current context embedded feature obtained by all attention heads, obtain the output result of the multi-head attention as the context attention feature.
[0061] The specific acquisition method of the context attention feature can refer to the acquisition method of the multi-head attention value described above.
[0062] Further, in S406, the node weight W of the a-th node in the fully connected graph a satisfies the following conditions:
[0063] W a = (e C(a) ) / ∑ N b1=1 e C(b1) ; C(a) is the attention score between the current context embedding feature corresponding to the single-head attention layer and the node embedding feature of the a-th node. Among them, C(a) satisfies the following conditions: If the a-th node is a candidate node, C(a) = G • tanh(q s k sa T / (d k ) 1 / 2 ); where, • represents dot product, G is a preset value, tanh() is the hyperbolic tangent function, q s is the current context embedding feature corresponding to the single-head attention layer, q s = W s q A c , W s q is the query weight matrix of the single-head attention layer, A c is the context attention feature, k sa is the key vector corresponding to the a-th node obtained by the single-head attention layer, k sa = W s k h a , W s k is the key weight matrix of the single-head attention layer. If the a-th node is not a candidate node, C(a) is equal to negative infinity; C(b1) is the attention score between the current context embedding feature corresponding to the single-head attention layer and the node embedding feature of the a-th node.
[0064] In the embodiment of the present invention, the output range of C(a) is converted from tanh and G to the interval [-G, G], and the larger value allows the model to learn more complex feature representations. In a schematic embodiment, G = 10. S500, obtain the total resource demand value corresponding to each candidate node sequence set, obtain k total resource demand values, and use the candidate node sequence set corresponding to the smallest of the k total resource demand values as the target node sequence set of the current event to be processed.
[0065] In the embodiment of the present invention, the total resource demand value D corresponding to the r-th starting node rMeet the following conditions:
[0066] D r =∑ f(r) i=1 ∑ z(r) u=1 RC iu ×x iu +∑ z(r) u=1 P u ×T u ×I u ; where RC iu is the specific resource required for the i-th execution object to execute the pending event corresponding to the u-th node, specifically the operating cost. The value of i ranges from 1 to f(r), where f(r) is the number of execution objects corresponding to the r-th starting node. The value of u ranges from 1 to z(r), where z(r) is the number of nodes in the candidate node sequence set corresponding to the r-th starting node; x iu is a variable. If the i-th execution object executes the pending event corresponding to the u-th node, x iu = 1; otherwise, x iu = 0; P u is the delay coefficient corresponding to the u-th node. If x iu = 1, P u = Q u-front + (1 - Q u-front ) × P u-front , Q u-front is the delay coefficient determined based on the slack time between the previous node of the j-th node and the j-th node, and P u-front is the delay coefficient of the previous node of the j-th node, T u is the historical average delay time corresponding to the u-th node, and I u is the resource value required for the delay of the u-th node, i.e., the delay cost.
[0067] Those skilled in the art know that if x iu = 0, it means that the i-th execution object does not execute the pending event corresponding to the u-th node, so P u = 0.
[0068] Furthermore, in the embodiments of the present invention, the trained node sequence determination model is obtained through the following steps:
[0069] S10, construct an initial node sequence determination model, that is, initialize the parameters of the node sequence determination model.
[0070] S20, divide the sample data set into B batches of training data sets, where the sample data set consists of multiple pending events within a set time period, i.e., flight plans.
[0071] In the embodiment of the present invention, B can be an empirical value.
[0072] S30. Based on the training data set of the current batch, construct a corresponding fully connected graph and input it into the current node sequence determination model to obtain a target node sequence set corresponding to the training data set of the current batch; the initial value of the current node sequence determination model is the initial node sequence determination model.
[0073] For the specific obtaining process of the target node sequence set corresponding to the training data set of the current batch, reference can be made to the content defined in the foregoing S200 to S500.
[0074] S40. Obtain the gradient of the total resource requirement value corresponding to the candidate node sequence set corresponding to the training data set of the current batch as the current gradient, and update the parameters of the current node sequence determination model based on the current gradient; wherein, the current gradient ▽J satisfies the following condition: ▽J≈(1 / kc)∑ kc v=1 (D v -D avg )▽log(W v1 ×……×W vb2 ×……×W vz(v) ), ▽ represents the gradient, D v is the total resource requirement value corresponding to the v-th starting node corresponding to the training data set of the current batch, D avg is the average value of the total resource requirement values corresponding to the k starting nodes corresponding to the training data set of the current batch, the value of v ranges from 1 to k, and W vb2 is the node weight of the b2-th node in the candidate node sequence set corresponding to the v-th starting node, the value of b2 ranges from 1 to z(v), and z(v) is the number of nodes in the candidate node sequence set corresponding to the v-th starting node.
[0075] S50. Determine whether the current node sequence determination model meets the preset model end condition. If it meets, determine the current node sequence as the trained node sequence determination model; otherwise, use the training data set of the next batch as the training data set of the current batch and execute S40.
[0076] In the embodiment of the present invention, the preset model end condition can be set according to actual needs. For example, the number of iterations reaches the preset number or the total resource requirement value is in the minimum state, etc.
[0077] In summary, the method for determining the flight string node sequence provided by the embodiment of the present invention has at least the following advantages:
[0078] 1. Improve the accuracy of the node sequence
[0079] Traditional methods usually start looking for the optimal solution from a fixed starting point, which may cause the algorithm to fall into a local optimum. In contrast, the present invention randomly selects multiple starting points and generates a set of candidate node sequences based on these starting nodes respectively, which can increase the diversity of the search space and contribute to finding the global optimum. The present invention enables the intelligent agent to repeatedly solve the same problem from different entry points, thereby exposing it to various problem-solving techniques. This method of optimizing the multiple-optimum strategy significantly improves the accuracy of the finally obtained node sequence.
[0080] 2. Enhance the applicability and robustness of the model
[0081] The present invention selects the node sequence with the minimum total resource requirement value as the target node sequence, taking into account not only the direct resources required for executing the event but also the potential costs brought by delays, thus ensuring the feasibility and economy of the generated node sequence in actual operation. This strategy makes the obtained node sequence more in line with the actual application scenario and enhances the applicability and robustness of the model.
[0082] 3. Optimize the flight schedule and reduce costs
[0083] The present invention generates a more reasonable flight string by comprehensively considering various factors such as the spatio-temporal connection between flights, aircraft type constraints, and airport connection. This optimized flight schedule reduces the unnecessary number of aircraft and the cost of aircraft type assignment, while also reducing the potential delay cost, thereby achieving a reduction in the total cost.
[0084] 4. Reduce the flight delay time
[0085] When generating the node sequence, the present invention fully considers factors such as the slack time between flights and the historical average delay time. By optimizing the arrangement of the flight string, the delay propagation between flights is reduced, thereby reducing the total delay time.
[0086] 5. Improve the solution efficiency
[0087] The present invention adopts a deep learning-based method. By training the node sequence determination model, it can quickly generate an optimized solution after a given input. Compared with traditional iterative algorithms, the present invention avoids the process of re-iterating when solving new instances, thereby improving the solution efficiency.
[0088] An embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0089] An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions for executing the method according to the embodiment of the present invention.
[0090] It should be understood that various forms of the processes shown above may be used, steps may be reordered, added or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved, and no limitations are imposed herein.
[0091] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for determining a flight string node sequence, characterized in that, The method is implemented based on a trained node sequence determination model, and the trained node sequence determination model includes a starting node selection module, a node embedding feature extraction module, and a target node acquisition module; the method includes the following steps: S100. Based on the current set of events to be processed, construct a fully connected graph; one event to be processed in the current set of events to be processed represents a flight, the fully connected graph is an undirected graph with self-connections, the nodes in the fully connected graph represent the events to be processed, and any two nodes are connected by an undirected edge; S200. Input the fully connected graph into the starting node selection module to randomly select k nodes from all the nodes in the fully connected graph as starting nodes and input them to the target node acquisition module; k > 1; S300. Input the fully connected graph into the node embedding feature extraction module to extract the node embedding features of all the nodes in the fully connected graph and input the extracted node embedding features to the target node acquisition module; S400. For each starting node, use the target node acquisition module to obtain the set of node sequences corresponding to each starting node as a candidate node sequence set, and obtain k candidate node sequence sets; wherein, each candidate node sequence in the candidate node sequence set is executed by the same execution object; S500. Obtain the total resource requirement value corresponding to each candidate node sequence set, obtain k total resource requirement values, and use the candidate node sequence set corresponding to the minimum value among the k total resource requirement values as the target node sequence set of the current event to be processed; The target node acquisition module includes a candidate node selection unit, a multi-head attention layer, a single-head attention layer, and a target node selection unit; S400 specifically includes: S401. Set the starting node counter r = 1; S402. If r ≤ k, set the execution object counter g = 1 and execute S403; if r > k, obtain k candidate node sequence sets and execute S500; S403. If the current node set is not empty, execute S404; otherwise, obtain the candidate node sequence set corresponding to the r-th starting node, set r = r + 1, and execute S402; the initial value of the current node set is the node set formed by all the nodes in the fully connected graph; S404. Use the candidate node selection unit to select nodes from the current node set that satisfy the preset constraint conditions with the currently selected node corresponding to the g-th execution object. If nodes that satisfy the preset constraint conditions with the currently selected node corresponding to the g-th execution object are obtained, use the obtained nodes that satisfy the preset constraint conditions with the currently selected node corresponding to the g-th execution object as the current candidate nodes of the g-th execution object and execute S405; if nodes that satisfy the preset constraint conditions with the currently selected node corresponding to the g-th execution object are not obtained, execute S409; wherein, the initial value of g is 1, and the initial value of the currently selected node corresponding to the 1st execution object is the r-th starting node; S405. Based on the average of the node embedding features of all nodes in the fully-connected graph, the node embedding features of the currently selected nodes corresponding to the g-th execution object, and the number of currently used execution objects, use the multi-head attention layer to obtain the context attention features corresponding to the fully-connected graph as the current context attention features corresponding to the g-th execution object; S406. Based on the current context attention features corresponding to the g-th execution object, use the single-head attention layer to obtain the node weights of each node in the fully-connected graph as the current node weights corresponding to the g-th execution object; S407. Based on the current node weights corresponding to the g-th execution object, use the target node selection unit to obtain a target node from the current candidate nodes of the g-th execution object as the current target node corresponding to the g-th execution object; wherein, the current target node corresponding to the g-th execution object is the node corresponding to the maximum node weight in the current node weights of the g-th execution object; S408. Use the current target node corresponding to the g-th execution object as the currently selected node corresponding to the g-th execution object, and add it to the set of currently selected nodes corresponding to the g-th execution object, and delete the current target node corresponding to the g-th execution object from the current set of nodes, and execute S403; the initial value of the set of currently selected nodes corresponding to the g-th execution object is empty; S409. Obtain the candidate node sequence corresponding to the g-th execution object based on the set of currently selected nodes corresponding to the g-th execution object, set g = g + 1, and randomly select a node from the current set of nodes as the initial value of the currently selected node corresponding to the (g + 1)-th execution object, and execute S403; The total resource requirement value D corresponding to the r-th starting node r Satisfies the following conditions: D r =∑ f(r) i=1 ∑ z(r) u=1 RC iu ×x iu +∑ z(r) u=1 P u ×T u ×I u ; where, RC iu is the resource required for the i-th execution object to execute the to-be-processed event corresponding to the u-th node. The value range of i is from 1 to f(r), where f(r) is the number of execution objects corresponding to the r-th starting node. The value range of u is from 1 to z(r), where z(r) is the number of nodes in the candidate node sequence set corresponding to the r-th starting node; x iu is a variable. If the i-th execution object executes the to-be-processed event corresponding to the u-th node, x iu = 1; otherwise, x iu = 0; P u is the delay coefficient corresponding to the u-th node. If x iu = 1, P u = Q u-front + (1 - Q u-front ) × P u-front , where Q u-front is the delay coefficient determined based on the slack time between the previous node of the j-th node and the j-th node, and P u-front is the delay coefficient of the previous node of the j-th node, T u is the historical average delay time corresponding to the u-th node, and I u is the resource value required for the delay of the u-th node. The slack time between two flights is the difference between the planned layover time difference of the two flights and the minimum layover time.
2. The method according to claim 1, characterized in that, The preset constraint conditions satisfy the following conditions: If M j = 1, it means that the j-th node in the current node set is a candidate node for the currently selected node. If M j = 0, it means that the j-th node in the current node set is not a candidate node for the currently selected node, where M j is the total constraint value corresponding to the j-th node, and M j = C j ⊙ C j E ⊙ C j L , C j is the transfer time constraint value corresponding to the j-th node, and C j E is the aircraft type constraint value corresponding to the j-th node, and C j E is the airport connection constraint value corresponding to the j-th node, and C j satisfies the following conditions: If the slack time between the currently selected node and the j-th node is greater than or equal to 0, C j = 1, otherwise, C j = 0; C j E satisfies the following conditions: If the aircraft type corresponding to the currently selected node is applicable to the j-th node, C j E = 1, otherwise, C j E = 0; C j L satisfies the following conditions: If the departure airport corresponding to the j-th node is the same as the airport corresponding to the currently selected node, C j L = 1, otherwise, C j L = 0; ⊙ represents the exclusive NOR operation, and j ranges from 1 to Q, where Q is the number of nodes in the current node set.
3. The method according to claim 2, wherein In S405, using the multi-head attention layer to obtain the context attention features corresponding to the fully-connected graph specifically includes: S4051, obtain the current stitching feature FP; where FP satisfies the following conditions: if the time step t = 1, FP = [F avg , z, P t , if t > 1, FP = [F avg , F t , P t , F avg is the average of the node embedding features of all nodes, z is the set input placeholder, P t is the number of execution objects that have been used currently, and F t is the node embedding feature of the currently selected nodes; S4052. Respectively use each attention head of the multi-head attention layer to obtain the attention score vector between the current context embedding features and the node embedding features of all nodes in the fully-connected graph; S4053, obtaining the attention value Av = ∑ of the current context embedding feature based on the attention score vector between the current context embedding feature obtained by each attention head and all nodes in the fully connected graph N a=1 (e S(c,a) / ∑ N b1=1 e S(c,b1) ) × v a , where S(c, b1) is the attention score between the current context embedding feature and the node embedding feature of the b1-th node in the fully connected graph, b1 ranges from 1 to N, and e is a natural number; S4054. Based on the attention values of the current context embedding features obtained by all attention heads, obtain the output result of the multi-head attention as the context attention features.
4. The method according to claim 3, characterized in that, The query vector q corresponding to the current context embedding feature c The following conditions are met: c =W Q ×FP,W Q is the query weight matrix of the attention head, and the key vector k corresponding to the a-th node in the fully connected graph a =W K ×h a , the value vector v corresponding to the a-th node a =W V ×h a , W K is the key weight matrix of the attention head, h a is the node embedding feature of the a-th node, W V is the value weight matrix of the attention head, where if the a-th node is not a candidate node, the attention score between the current context embedding feature and the node embedding feature of the a-th node is set to negative infinity; if the a-th node is not a candidate node, the attention score between the current context embedding feature and the node embedding feature of the a-th node is set to S(c, a)=q c k a T / (d k ) 1 / 2 , d k is the dimension of the key vector, a ranges from 1 to N, where N is the number of nodes in the fully connected graph.
5. The method according to claim 3, characterized in that, In S406, the node weight W of the a-th node in the fully connected graph a satisfies the following conditions: W a = (e C(a) ) / ∑ N b1=1 e C(b1) ; C(a) is the attention score between the current context embedding feature corresponding to the single-head attention layer and the node embedding feature of the a-th node. Among them, C(a) satisfies the following conditions: If the a-th node is a candidate node, C(a) = G • tanh(q s k sa T / (d k )) 1 / 2 ; where, • represents dot product, G is a preset value, tanh() is the hyperbolic tangent function, q s is the current context embedding feature corresponding to the single-head attention layer, q s = W s q A c , W s q is the query weight matrix of the single-head attention layer, A c is the context attention feature, k sa is the key vector corresponding to the a-th node obtained by the single-head attention layer, k sa = W s k h a , W s k is the key weight matrix of the single-head attention layer. If the a-th node is not a candidate node, C(a) is equal to negative infinity; C(b1) is the attention score between the current context embedding feature corresponding to the single-head attention layer and the node embedding feature of the b1-th node.
6. The method according to claim 1, wherein The node embedding feature extraction module includes: a node embedding module, and M encoding modules connected in sequence. Each encoding module includes a multi-head self-attention layer, a first splicing processing module, a feed-forward neural network layer, and a second splicing processing module connected in sequence. The node embedding module is respectively connected to the multi-head self-attention layer and the first splicing processing of the first encoding module. The first splicing processing module of each encoding module is also connected to the corresponding second splicing processing module. The second splicing processing module of the previous encoding module in two adjacent encoding modules is respectively connected to the multi-head self-attention layer and the first splicing processing module of the subsequent encoding module. The second splicing processing module of the Mth encoding module is connected to the target node acquisition module. Both the first splicing processing module and the second splicing processing module are used for: splicing the received input features to obtain the corresponding splicing result, and performing affine transformation batch normalization processing on the splicing result, where M>1.
7. The method according to claim 5, wherein The trained node sequence determination model is obtained through the following steps: S10. Construct an initial node sequence determination model; S20. Divide the sample data set into B batches of training data sets, where the sample data set consists of multiple events to be processed within a set time period; S30. Based on the current batch of training data set, construct a corresponding fully connected graph and input it into the current node sequence determination model to obtain a target node sequence set corresponding to the current batch of training data set; the initial value of the current node sequence determination model is the initial node sequence determination model; S40. Obtain the gradient of the total resource requirement value of the candidate node sequence set corresponding to the current batch of training data set as the current gradient, and update the parameters of the current node sequence determination model based on the current gradient; S50. Determine whether the current node sequence determination model meets the preset model end condition. If it meets, determine the current node sequence as the trained node sequence determination model. Otherwise, use the next batch of training data set as the current batch of training data set and execute S40.
8. The method according to claim 7, wherein Among them, The current gradient ▽J satisfies the following condition: ▽J≈(1 / k)∑ k v=1 (D v -D avg )▽log(W v1 ×……×W vb2 ×……×W vz(v) ), where ▽ represents the gradient, D v is the total resource demand value corresponding to the v-th starting node of the training data set for the current batch, D avg is the average of the total resource demand values corresponding to the k starting nodes of the training data set for the current batch, v takes values from 1 to k, W vb2 is the node weight of the b2-th node in the candidate node sequence set corresponding to the v-th starting node, b2 takes values from 1 to z(v), and z(v) is the number of nodes in the candidate node sequence set corresponding to the v-th starting node.
Citation Information
Patent Citations
Power grid fault detection point deployment method based on PSO and ant colony-genetic algorithm
CN110798351A
User portrait construction method and system based on scientific research network
CN114329232A