Flight delay prediction method and device based on dynamic graph structure and graph attention
By integrating aircraft models and weather characteristics based on dynamic graph structure and graph attention, the flight delay time is predicted, and the problem of failure to effectively utilize complex factors in the existing technology is solved, and more accurate flight delay prediction is achieved.
Patent Information
- Application Number
- CN202411272553.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-31
AI Technical Summary
The existing flight delay prediction methods fail to fully utilize complex factors that affect flight delays, such as weather changes, model characteristics and flight density, and the data processed is static data, ignoring the time and spatial dynamics of flight data.
Using a method based on dynamic graph structure and graph attention, the airport node set and adjacency matrix are constructed by obtaining and dividing it into unit time windows, integrating aircraft models, airlines and weather characteristics as node characteristics, and diffusion volumes The Jihe multi-head attention mechanism captures the time and space dependence between flights and predicts flight delay time.
Improve the accuracy of flight delay prediction, consider aircraft model and weather data, build a dynamic graph structure to simulate the multi-dimensional interaction between flights and airports, capture the time and space dependence between flights, and obtain more accurate prediction results.
Smart Images

Figure CN119227878A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology applications, and in particular to a flight delay prediction method and device based on dynamic graph structure and graph attention. Background Art
[0002] In the context of a globalized economy, air transport is a key link connecting the world, and its efficiency and reliability have a profound impact on economic and social activities. However, flight delays are common in the global aviation network, which not only causes inconvenience to passengers, but also brings economic burdens to airlines, affecting flight scheduling and operational efficiency. Therefore, it is necessary to accurately predict flight delays. Currently, flight delays are mainly predicted by various statistical and machine learning methods, but these prediction methods fail to fully utilize the complex factors that affect flight delays, such as weather changes, aircraft characteristics, and flight density. In addition, most existing models usually deal with static data and ignore the dynamic nature of flight data in time and space. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to a first aspect of the present invention, a flight delay prediction method based on dynamic graph structure and graph attention is provided, the method comprising the following steps:
[0005] S100, obtaining a basic data set, wherein the basic data set includes n basic data groups, each basic data group corresponds to basic data within a set unit time window, and the basic data includes flight data and weather data within the corresponding set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window.
[0006] S200, based on the t-th basic data group, construct a corresponding graph structure G for the t-th basic data group t = {V t , X t , A t}, where V t is the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, X t V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where Vt The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Aw t i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t is from 1 to n.
[0007] S300, for the jth flight A that needs to be predicted to have a take-off delay within the unit time window that needs to be predicted c j ,ori , get A c j,ori The corresponding departure flight characteristics f c j,ori , and obtain A c j,ori The node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori It is obtained based on the node characteristics of the departure airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window after the unit time window corresponding to the n-th basic data group.
[0008] S400, for c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori A c j,ori The takeoff delay time is predicted and the corresponding predicted takeoff delay time T is obtained. c j,ori .
[0009] S500, Get A c j,ori The corresponding arrival flight feature f c j,dep , and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight.c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep ;f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep It is obtained based on the node features of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted.
[0010] S600, for c j,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep A c j,dep The arrival delay time is predicted and the corresponding predicted arrival delay time T is obtained. c j,dep .
[0011] According to a second aspect of the present invention, a flight delay prediction device based on a dynamic graph structure and graph attention is provided, the device comprising:
[0012] A basic data acquisition module is used to acquire a basic data set, wherein the basic data set includes n basic data groups, each basic data group corresponds to basic data within a set unit time window, and the basic data includes flight data and weather data within the corresponding set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window.
[0013] A graph structure building module is used to build a corresponding graph structure G for the tth basic data group based on the tth basic data group. t = {V t , X t , A t}, where V t is the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, Xt V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where V t The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Aw t i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t is from 1 to n.
[0014] The flight departure delay prediction module is used to obtain the jth flight A that needs to be predicted to be delayed within the unit time window that needs to be predicted. c j,ori The corresponding departure flight characteristics f c j,ori , and obtain A c j,oriThe node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori , and for f c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori Get an A c j,ori The corresponding predicted takeoff delay time T c j,ori ; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori It is obtained based on the node characteristics of the departure airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window after the unit time window corresponding to the n-th basic data group.
[0015] Flight arrival delay prediction module, used to obtain A c j,oriThe corresponding arrival flight feature f c j,dep =(fc c j , fc c j , T c j,ori ), and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight. c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep , and for f c j ,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep Get an A c j,dep The corresponding predicted arrival delay time T c j,dep ; Among them, f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep It is obtained based on the node features of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted.
[0016] The present invention has at least the following beneficial effects:
[0017] The embodiment of the present invention provides a flight delay prediction method based on a dynamic graph structure and graph attention. First, the basic data is divided according to a set unit time window to obtain multiple basic data groups, and then a corresponding graph structure is constructed for each basic data group. The aircraft type, airline and weather characteristics are used as node features. Then, the flight characteristics, previous node characteristics and current node characteristics corresponding to the flight to be predicted are fused as a take-off delay time feature vector to obtain the predicted take-off delay time, wherein the current node characteristics are obtained by performing diffusion convolution on the corresponding node characteristics in the previous time window, and the flight characteristics incorporate the take-off delay time of the previous flight on the flight chain. Then, the arrival delay time is predicted in combination with the predicted take-off delay time. In the present invention, since the flight data and weather data including the aircraft type are taken into consideration, a dynamic graph structure is constructed to simulate the multi-dimensional interaction between airports and flights, and the spatiotemporal dependency between flights is captured through the graph attention mechanism, which can make the prediction result more accurate.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended 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
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A flowchart of a flight delay prediction method based on dynamic graph structure and graph attention provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0023] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts 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 operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0024] The embodiment of the present invention provides a flight delay prediction method based on dynamic graph structure and graph attention, such as Figure 1 As shown, the method may include the following steps:
[0025] S100, obtaining a basic data set, wherein the basic data set includes n basic data groups, each basic data group corresponds to basic data within a set unit time window, and the basic data includes flight data and weather data within the corresponding set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window.
[0026] In an embodiment of the present invention, the basic data set may be time series data within a set historical time period, which is used for prediction. The value of n may be set based on actual needs, for example, n=3, 6, 12, etc. The basic data set may include airport data corresponding to a set number of airports.
[0027] In the embodiment of the present invention, the length of the unit time window may be set based on actual needs. In an exemplary embodiment, the length of the unit time window may be set to 30 minutes.
[0028] In an embodiment of the present invention, the flight data may include at least the flight date, airline ID, aircraft tail number, departure airport, planned departure time, departure delay time, arrival airport, planned arrival time, the distance between the departure airport and the arrival airport, aircraft model, etc.
[0029] In the embodiment of the present invention, the aircraft model can be determined according to the number of seats of the aircraft. Different numbers of seats correspond to different types of aircraft models. The aircraft model can be determined using existing methods.
[0030] In an embodiment of the present invention, the weather data may include at least air temperature, dew point humidity, relative humidity, wind speed, sea level pressure, visibility, etc.
[0031] Those skilled in the art know that the flight data and weather data are data that have been processed by data cleaning and merging, and the specific data cleaning and merging methods may be existing technologies.
[0032] S200, based on the t-th basic data group, construct a corresponding graph structure G for the t-th basic data group t = {V t , X t , A t}, where V t is the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, X t V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where V t The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Awt i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t is from 1 to n.
[0033] The inventor of the present invention has found through research that aircraft model, airline company and weather data are important potential influencing factors of delay. Therefore, aircraft model, airline company and weather data are used as node features.
[0034] In the embodiment of the present invention, Add t i Equal to V t The average value of the sum of the take-off delay times of flights at the airport corresponding to the i-th node in the corresponding time window, Aad t i Equal to V t The average value of the sum of the arrival delay times of the flights at the airport corresponding to the i-th node in the corresponding time window. The specific calculation method may be the existing technology, which will not be described in detail in the present invention.
[0035] In the embodiment of the present invention, Aw t i The following conditions must be met:
[0036] A t i =∑ w r=1 A t ir ×2 r , where Aw t ir V t The eigenvalue corresponding to the rth weather data among the w weather data in the corresponding time window of the airport corresponding to the i-th node in , and the value of r ranges from 1 to w.
[0037] In an embodiment of the present invention, the characteristic value corresponding to the weather data may be normalized data. For example, for temperature, it may be normalized data of the average value of all temperature data in the corresponding unit time window. In an embodiment of the present invention, each binary bit is used to represent an independent weather condition. In this way, each weather condition corresponds to a specific location, ensuring a clear distinction between different weather conditions. At the same time, such encoding reduces the dimension of the model input data while ensuring the diversity of the input data, which can reduce the amount of calculation to a certain extent.
[0038] Position coding is a very important concept in time series analysis. Since flight data has a strict order in the time dimension, it is necessary to use time position coding before predicting flight delays. t i The following conditions must be met:
[0039] If (pos t / (10000 2n / d )) is an even number, L t = sin(pos t / (10000 2n / d )), if (pos t / (10000 2n / d )) is an odd number, L t =cos(pos t / (10000 2n / d )),pos t is the position value of the tth basic data group among the n basic data groups, and d is the preset encoding dimension.
[0040] The position coding in the embodiment of the present invention can provide continuous input of time information while retaining sensitivity to different time scales, and is a very effective method for processing complex flight data.
[0041] In an embodiment of the present invention, the node relationship may include a distance relationship, a number of departing flights, and a number of arriving flights. Taking node 1 and node 2 as an example, the distance relationship between node 1 and node 2 may be the relative distance between the two airports corresponding to node 1 and node 2, which may be obtained based on historical data within a set historical time period, such as 5 years. The number of departing flights between node 1 and node 2 may be the number of flights departing from the airport corresponding to node 1 to the airport corresponding to node 2 within a set historical time period, such as the past 5 years, and the number of arriving flights between node 1 and node 2 may be the number of flights departing from the airport corresponding to node 2 to the airport corresponding to node 1 within a set historical time period.
[0042] The dynamic graph structure constructed by the embodiment of the present invention can simulate how flight delays propagate over time and location. If a hub airport is delayed, its impact will be transmitted to other airports through departing flights. In addition, the delay pattern within the time window is also used to predict possible delays in future time periods.
[0043] S300, for the jth flight A that needs to be predicted to have a take-off delay within the unit time window that needs to be predicted c j ,ori , get A c j,oriThe corresponding departure flight characteristics f c j,ori , and obtain A c j,ori The node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori ; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori It is obtained based on the node characteristics of the departure airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window after the unit time window corresponding to the n-th basic data group, that is, the first unit time window that needs to be predicted.
[0044] In the embodiment of the present invention, g may be set based on actual needs, and g may be equal to n.
[0045] In this embodiment of the present invention, a diffuse convolution is used to simulate how this information is propagated in each airport node through edges, and a multi-head attention mechanism is introduced to dynamically capture the influence of each relationship.
[0046] Specifically, X c j,ori The following conditions must be met:
[0047] Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
[0048] In the embodiment of the present invention, the adjacency matrix corresponding to each node relationship corresponds to a different attention head, and each attention head defines an association matrix A q ,so, is the normalized transfer matrix of the qth node relationship, W q,k is the weight matrix corresponding to the qth relationship in the kth diffusion step, where k ranges from 1 to Q, and Q is the number of diffusion steps.
[0049] in, Q iq From X c j,ori The query matrix K is obtained by transforming the learned weight matrix. iq From X c j,ori The key matrix obtained by converting the learned weight matrix, d k is the feature dimension.
[0050] In the embodiment of the present invention, diffuse convolution is used to obtain node features of nodes to be predicted, which allows each node to collect and aggregate information from multiple neighbors, including neighbors at different distances. This multi-level information aggregation mechanism enables nodes to obtain a more comprehensive local view, improving the richness and accuracy of feature representation.
[0051] S400, for c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori A c j,ori The takeoff delay time is predicted and the corresponding predicted takeoff delay time T is obtained.c j,ori .
[0052] S500, Get A c j,ori The corresponding arrival flight feature f c j,dep , and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight. c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep ;f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep It is obtained based on the node features of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted.
[0053] In the embodiment of the present invention, X c j,dep The following conditions must be met:
[0054] Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship Diffused convolution features obtained by performing diffuse convolution.
[0055] is the normalized transfer matrix of the qth node relationship, W q,k is the weight matrix corresponding to the qth relationship in the kth diffusion step, where k ranges from 1 to Q, and Q is the number of diffusion steps.
[0056] in, Q iq From X cj,dep The query matrix K is obtained by transforming the learned weight matrix. iq From X c j,ori The key matrix obtained by converting the learned weight matrix, d k is the feature dimension.
[0057] S600, for c j,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep Lose to A c j,dep The arrival delay time is predicted and the corresponding predicted arrival delay time C is obtained. c j,dep .
[0058] The flight delay prediction method based on dynamic graph structure and graph attention provided in the embodiment of the present invention can be implemented through a flight delay prediction model. In the embodiment of the present invention, the flight delay prediction model may include a position encoding module, a dynamic graph construction module, a time position encoding convolution module, a spatial attention convolution module, a flight chain feature extraction module, and a multi-layer perception prediction module. Among them, the position encoding module, the dynamic graph construction module, the time position encoding convolution module, and the spatial attention convolution module are connected in sequence, the input of the flight chain feature extraction module is flight data, and the output is the input of the multi-layer perception prediction module, the input of the dynamic graph construction module is flight data and encoded weather data, and the output of the spatial attention convolution module is the input of the multi-layer perception prediction module.
[0059] Among them, the position encoding module is used to encode the weather data to obtain the corresponding weather features. The dynamic graph construction module is used to construct the corresponding graph structure for each unit time window based on the received flight data and weather data. The time position encoding convolution module is used to encode the position of the unit time window, and the time attention convolution module is used to obtain the features of the nodes corresponding to each flight that needs to be predicted. The flight chain feature extraction module is used to obtain the flight chain to which the flight that needs to be predicted belongs. The multi-layer perception prediction module is used to predict the departure delay time and arrival delay time of the flight.
[0060] The flight delay prediction model provided by the embodiment of the present invention may be a trained flight delay prediction model. The flight delay prediction model may be obtained through training based on sample data, and the sample data may be airport data within a set historical time period, such as 1 year. The acquired sample data may be grouped according to year, month, and day, and the daily flight data may be sorted according to the planned departure time. The flight data and weather data are divided and integrated based on the unit time window to obtain sample data corresponding to multiple unit time windows. During training, a set number of sample data corresponding to, for example, g unit time windows may be input each time to predict the delay of one or more flights within g unit time windows in the future. It is known to those skilled in the art that the specific method for training the model may be a prior art, and to avoid redundancy, the present invention does not describe it in detail.
[0061] In order to objectively evaluate the prediction performance of the flight delay prediction method based on dynamic graph structure and graph attention provided by the embodiment of the present invention, three prediction methods, XGBoost, RandomForest, and LightGBM, were selected to conduct comparative experiments on the same test set. The experimental results obtained can be shown in Table 1 below:
[0062] Table 1
[0063]
[0064]
[0065] As can be seen from Table 1 above, the flight delay prediction method based on dynamic graph structure and graph attention provided by the embodiment of the present invention is superior to the existing prediction method in terms of the three evaluation indicators of AMAE, RMSE and R2, and can further improve the prediction accuracy. Based on the same inventive concept, the embodiment of the present invention also provides a flight delay prediction device based on dynamic graph structure and graph attention, the device comprising:
[0066] A basic data acquisition module is used to acquire a basic data set, wherein the basic data set includes n basic data groups, each basic data group corresponds to basic data within a set unit time window, and the basic data includes flight data and weather data within the corresponding set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window.
[0067] A graph structure building module is used to build a corresponding graph structure G for the tth basic data group based on the tth basic data group. t = {V t , X t , A t}, where V tis the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, X t V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where V t The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Aw t i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t is from 1 to n.
[0068] The flight departure delay prediction module is used to obtain the jth flight A that needs to be predicted to be delayed within the unit time window that needs to be predicted. c j,ori The corresponding departure flight characteristics f c j,ori, and obtain A c j,ori The node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori , and for f c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori Get an A c j,ori The corresponding predicted takeoff delay time T c j,ori ; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori It is obtained based on the node characteristics of the departure airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window after the unit time window corresponding to the n-th basic data group.
[0069] Flight arrival delay prediction module, used to obtain Ac j,ori The corresponding arrival flight feature f c j,dep =(fc c j , fc c j , T c j,ori ), and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight. c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep , and for f c j ,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep Get an A c j,dep The corresponding predicted arrival delay time T c j,dep ; Among them, f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep It is obtained based on the node features of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted.
[0070] Among them, X c j,ori The following conditions must be met:
[0071] Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
[0072] X c j,dep The following conditions must be met:
[0073] Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
[0074] A t i The following conditions must be met:
[0075] A t i =∑ w r=1 A t ir ×2 r , where Aw t ir V t The eigenvalue corresponding to the rth weather data among the w weather data in the corresponding time window of the airport corresponding to the i-th node in , and the value of r ranges from 1 to w.
[0076] The device can be used to perform Figure 1 Therefore, for the functions that can be realized by each functional module of the device, please refer to Figure 1 The description of the illustrated embodiment is not repeated in detail.
[0077] An embodiment of the present invention also provides an electronic device, comprising: 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.
[0078] The embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.
[0079] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0080] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A flight delay prediction method based on dynamic graph structure and graph attention, characterized in that: The method comprises the following steps: S100, obtaining a basic data set, the basic data set including n basic data groups, each basic data group corresponding to basic data within a set unit time window, the basic data including flight data and weather data corresponding to the set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window; S200, based on the t-th basic data group, construct a corresponding graph structure G for the t-th basic data group t = {V t , X t , A t }, where V t is the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, X t V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where V t The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Aw t i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t ranges from 1 to n; S300, for the jth flight A that needs to be predicted to have a take-off delay within the unit time window that needs to be predicted c j,ori , get A c j,ori The corresponding departure flight characteristics f c j,ori , and obtain A c j,ori The node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori ; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori Based on the node characteristics of the departure airport corresponding to the jth flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window located after the unit time window corresponding to the nth basic data group; S400, for c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori A c j,ori The takeoff delay time is predicted and the corresponding predicted takeoff delay time T is obtained. c j,ori ; S500, Get A c j,ori The corresponding arrival flight feature f c j,dep , and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight. c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep ;f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep Based on the node characteristics of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted; S600, for c j,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep A c j,dep The arrival delay time is predicted and the corresponding predicted arrival delay time T is obtained. c j,dep .
2. The method according to claim 1, characterized in that X c j,ori The following conditions must be met: Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
3. The method according to claim 1, characterized in that X c j,dep The following conditions must be met: Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
4. The method according to claim 1, characterized in that: The node relationship includes a distance relationship, a number of departing flights, and a number of arriving flights.
5. The method according to claim 1, characterized in that A t i The following conditions must be met: A t i =∑ w r=1 A t ir ×2 r , where Aw t ir V t The eigenvalue corresponding to the rth weather data among the w weather data in the corresponding time window of the airport corresponding to the i-th node in , and the value of r ranges from 1 to w.
6. The method according to claim 1, characterized in that L t i The following conditions must be met: If (pos t / (10000 2n / d )) is an even number, L t = sin(pos t / (10000 2n / d )), if (pos t / (10000 2n / d )) is an odd number, L t =cos(pos t / (10000 2n / d )),pos t is the position value of the tth basic data group among the n basic data groups, and d is the preset encoding dimension.
7. A flight delay prediction device based on dynamic graph structure and graph attention, characterized in that: The device comprises: A basic data acquisition module is used to acquire a basic data set, wherein the basic data set includes n basic data groups, each basic data group corresponds to basic data within a set unit time window, and the basic data includes flight data and weather data within the set unit time window, wherein the planned departure time in the flight data corresponding to any set unit time window is within the set unit time window; A graph structure building module is used to build a corresponding graph structure G for the tth basic data group based on the tth basic data group. t = {V t , X t , A t }, where V t is the airport node set consisting of the airports in the unit time window corresponding to the tth basic data set, X t V t The corresponding node feature set, A t V t The corresponding adjacency matrix, A t M×N t ×N t dimensional matrix, M is the type of node relationship, N is t is the number of airports in the unit time window corresponding to the tth basic data group; where V t The node feature X corresponding to the i-th node in t i =(At t i ,Ac t i , Add t i , Aad t i , Aw t i , L t ), At t i V t The aircraft types that take off and land at the airport corresponding to the i-th node in the corresponding time window, Ac t i V t The ID of the airline that performs flight missions at the airport corresponding to the i-th node in the corresponding time window, Add t i V t The average take-off delay time of the airport corresponding to the i-th node in the corresponding time window, Aad t i V t The average arrival delay time of the airport corresponding to the i-th node in the corresponding time window, Aw t i V t The weather characteristics of the airport corresponding to the i-th node in the corresponding time window, L t is the position code corresponding to the unit time window corresponding to the tth basic data group; the value of i ranges from 1 to N t , the value of t ranges from 1 to n; The flight departure delay prediction module is used to obtain the jth flight A that needs to be predicted to be delayed within the unit time window that needs to be predicted. c j,ori The corresponding departure flight characteristics f c j,ori , and obtain A c j,ori The node features corresponding to the g unit time windows before the current unit time window that needs to be predicted for the corresponding departure airport are used as the preceding node features X corresponding to the jth flight. c,pre j,ori , and obtain the node feature X corresponding to the departure airport of the jth flight in the unit time window that needs to be predicted c j,ori , and for f c j,ori , X c,pre j,ori and X c j,ori Perform splicing and use the splicing result as A c j,ori The corresponding takeoff delay time prediction feature vector X c-p j,ori , and based on X c-p j,ori Get an A c j,ori The corresponding predicted takeoff delay time T c j,ori ; Among them, f c j,ori =(ft c j , fc c j ,fL c j , fLa c j ), ft c j is the aircraft model corresponding to the jth flight, fc c j is the ID of the airline corresponding to the jth flight, fLd c j is the departure delay time of the preceding flight in the flight chain corresponding to the jth flight, fLa c j is the arrival delay time of the previous flight in the flight chain corresponding to the jth flight, j ranges from 1 to h, and h is the number of flights in the unit time window that needs to be predicted. c j,ori Based on the node characteristics of the departure airport corresponding to the jth flight in the previous unit time window before the current unit time window that needs to be predicted; the initial value of the current unit time window that needs to be predicted is the first unit time window located after the unit time window corresponding to the nth basic data group; Flight arrival delay prediction module, used to obtain A c j,ori The corresponding arrival flight feature f c j,dep =(fc c j , fc c j , T c j ,ori ), and obtain A c j,ori The node features corresponding to the g unit time windows before the unit time window that needs to be predicted at the corresponding destination airport are taken as the preceding node features X corresponding to the jth flight. c,pre j,dep , and obtain the node feature X corresponding to the destination airport of the jth flight in the unit time window that needs to be predicted c j,dep , and for f c j,dep , X c,pre j,dep and X c j,dep Perform splicing and use the splicing result as A c j,ori The corresponding arrival delay time prediction feature vector X c-p j,dep , and based on X c-p j,dep Get an A c j,dep The corresponding predicted arrival delay time T c j,dep ; Among them, f c j,dep =(fc c j , fc c j , T c j,ori ), X c j,dep It is obtained based on the node features of the destination airport corresponding to the j-th flight in the previous unit time window before the current unit time window that needs to be predicted.
8. The device according to claim 7, characterized in that X c j,ori The following conditions must be met: Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the departure airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
9. The device according to claim 7, characterized in that X c j,dep The following conditions must be met: Among them, σ() represents the activation function, It represents the attention coefficient corresponding to the qth node relationship corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window to be predicted, is the node feature corresponding to the node corresponding to the destination airport corresponding to the jth flight in the previous unit time window of the current unit time window that needs to be predicted based on the attention head corresponding to the qth node relationship The diffuse convolution features obtained by performing diffuse convolution, · represents the dot product, and the value of q ranges from 1 to M.
10. The device according to claim 1, characterized in that A t i The following conditions must be met: A t i =∑ w r=1 A t ir ×2 r , where Aw t ir V t The eigenvalue corresponding to the rth weather data among the w weather data in the corresponding time window of the airport corresponding to the i-th node in , and the value of r ranges from 1 to w.
