Civil aviation field based on knowledge graph of type of user destination prediction method
By constructing a knowledge graph of user travel tasks and extracting feature vectors and classifying user types, a target time period strategy is formulated for both short-term and long-term users, which solves the problem of insufficient short-term user data in the civil aviation field and achieves higher prediction accuracy and timeliness.
Patent Information
- Application Number
- CN202511481799.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-10-16
AI Technical Summary
Traditional civil aviation user destination prediction methods struggle to extract effective features and patterns from limited data when dealing with short-term users, resulting in low prediction accuracy and failing to effectively address the impact of factors such as flight dynamics and weather changes on travel behavior.
A knowledge graph-based method for predicting user destinations is adopted. By constructing a knowledge graph of user travel tasks, feature vectors are extracted and user types are classified. Target time period strategies are formulated for long-term and short-term users respectively. Historical task information is integrated to generate a new knowledge graph and explore potential travel patterns.
It improves the accuracy and timeliness of predictions when short-term user data is insufficient, while also taking into account the pattern mining of long-term users, thus enhancing the accuracy and timeliness of destination predictions for different user types.
Smart Images

Figure CN120952121B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of destination prediction, in particular to a type-based user destination prediction method based on a knowledge graph in the civil aviation field. BACKGROUND
[0002] In the civil aviation field, the traditional prediction method is usually based on long-term and stable travel data of users, and the future destination is inferred by analyzing the historical travel rules. However, in actual application, there are a large number of short-term users whose travel behaviors do not form periodic rules. Such users often have short time span of travel data, few tasks, and stable travel rules, which makes it difficult for traditional methods to extract effective features and rules from limited data. Moreover, civil aviation travel has strong timeliness and temporary characteristics, and the user's travel decision is easily affected by factors such as flight dynamics and weather changes. For such users, if the full amount of historical data is still used for prediction, the accuracy of destination prediction will be low. SUMMARY
[0003] To solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0004] According to the type-based user destination prediction method based on a knowledge graph in the civil aviation field provided by the present application, the method comprises the following steps:
[0005] H100, obtaining each historical travel task information corresponding to the target user ID; each historical travel task information at least includes the start time of the corresponding travel task;
[0006] H200, taking each historical travel task information corresponding to the historical travel task as a node, and connecting each node in turn according to the chronological order of the travel task execution time to obtain the travel task knowledge graph HA corresponding to the target user ID; each node of HA includes the start time, end time, departure place and destination of the corresponding travel task;
[0007] H300, extracting the feature vector of HA to obtain the historical travel task feature vector HX corresponding to HA;
[0008] H400, inputting HX into a preset user type classification model to determine whether the user corresponding to the target user ID is a long-term user or a short-term user; wherein the long-term user is a user whose travel behavior forms a periodic rule, and the short-term user is a user whose travel behavior does not form a periodic rule;
[0009] H500, if the user corresponding to the target user ID is a long-term user, determining the time period corresponding to the earliest start time and the latest start time in the historical travel task of the target user ID as the target time period;
[0010] H600, if the user corresponding to the target user ID is a short-term user, determining a target time period corresponding to the target user ID according to the HA;
[0011] H700, obtaining a plurality of different types of historical task information corresponding to the target user ID in the target time period to generate a knowledge graph HZ corresponding to the target user ID;
[0012] H800, predicting a destination corresponding to the target user ID according to the HZ.
[0013] The present application has at least the following beneficial effects:
[0014] The type-based user destination prediction method based on a knowledge graph in the civil aviation field of the present application first constructs a user travel task knowledge graph, systematically integrates user historical travel information, and converts complex travel data into structured knowledge. On this basis, feature vectors are extracted and user types are classified to accurately identify long-term users and short-term users. Target time period determination strategies are developed for different types of users, and then multi-type historical task information in the target time period is integrated to generate a new knowledge graph, fully mining the potential travel patterns of users. Compared with the traditional scheme, this method effectively solves the prediction problems of insufficient data and difficult feature extraction of short-term users in the civil aviation field, while taking into account the regularity mining of long-term users, greatly improving the accuracy and timeliness of destination prediction for different user types. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor.
[0016] Figure 1 The flowchart of the type-based user destination prediction method based on a knowledge graph in the civil aviation field provided by the embodiments of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0018] It is noted that based on the present disclosure, one skilled in the art will appreciate that one aspect described herein can be implemented independently of any other aspects and that two or more of these aspects can be combined in various ways. For example, an apparatus can be implemented and / or a method can be practiced using any number of the aspects set forth herein. In addition, such an apparatus can be implemented and / or such a method can be practiced using other structure and / or functionality in addition to or other than one or more of the aspects set forth herein.
[0019] Embodiment one:
[0020] A civil aviation field type user destination prediction method based on knowledge graph is provided, specifically including the steps as shown in Figure 1
[0021] H100, obtaining each historical travel task information corresponding to the target user ID; each historical travel task information at least includes the start time of the corresponding travel task.
[0022] In this embodiment, the knowledge graph corresponding to the target user ID can be generated by the methods in subsequent embodiment two and embodiment three. If the target task is destination prediction, the type of the target user can be distinguished first, and then the accurate task prediction can be performed according to the user type.
[0023] The system retrieves the historical travel records of the target user, and each record contains the start time (such as 2024-01-15, 08:30), end time, departure place and destination of the travel task. For example, the historical records of user Zhang San may include "city 1→city 2, January 15, 2024" "city 2→city 3, February 20, 2024" and the like.
[0024] H200, each historical travel task information corresponding to the historical travel task is taken as a node, and each node is connected in turn according to the chronological order of the travel task execution time, to obtain the travel task knowledge graph HA corresponding to the target user ID; each node of HA includes the start time, end time, departure place and destination of the corresponding travel task.
[0025] Each travel task is abstracted as a node, and connected in chronological order to form a directed graph. For example: node 1 (city 1→city 2, 2024-01-15)→node 2 (city 2→city 3, 2024-02-20)→node 3 (city 3→city 1, 2024-03-10).
[0026] The travel trajectory chain of the user is intuitively displayed, for example, the business travel mode of "city 1→city 2→city 3" is identified; through the connection relationship of the nodes, the circular path (such as going back and forth between two cities every week) can be mined.
[0027] H300, eigenvector extraction is performed on the HA to obtain a historical travel task eigenvector HX corresponding to the HA.
[0028] Further, the step H300 can include the following steps:
[0029] H310, according to the HA, determining a structural complexity HD1 corresponding to the HA and a regularity HD2 of the target user travel; HD1 is obtained according to the node number corresponding to each node type in the HA, and HD2 is obtained according to the start time corresponding to each node in the HA.
[0030] Further, HD1 is obtained by the following steps:
[0031] H311, obtaining the node number corresponding to each type of node in the HA to obtain a node number list NA= (NA1, NA2, …, NA a , …, NA b ), a=1, 2, …, b; NA a is the node number corresponding to the a-th type of node in the HA, and b is the number of node types corresponding to the HA.
[0032] In this embodiment, the node types are, for example, departure place, destination, start time, etc. Through this step, the distribution of different types of nodes is quantified, providing original data for subsequent complexity calculation, and facilitating the judgment of the diversity of the graph structure.
[0033] H312, according to NA, determining the proportion corresponding to each type of node to obtain a node proportion list HP= (HP1, HP2, …, HP a , …, HP b ); HP a is the node proportion corresponding to NA a ; HP a =NA a / ∑ b a=1 NA a .
[0034] Converting the absolute number to the relative proportion eliminates the influence of the total number of nodes on the complexity calculation, so that graphs of different sizes can be compared.
[0035] H313, according to NA, determining HD1=-∑ b a=1 HP a ×log2HP a .
[0036] HD1 is calculated using the information entropy formula. The greater the entropy value, the more uniform the node type distribution and the more complex the graph structure. Quantifying the complexity of the graph structure through information entropy can be used to determine the diversity of user travel scenarios (e.g., whether it involves multiple types of departure / destination).
[0037] Further, HD2 is obtained by the following steps:
[0038] H314, obtaining the start time corresponding to each node in HA.
[0039] Extract the start time of each travel task node and arrange them in chronological order.
[0040] H315, obtaining the time interval between adjacent two start times.
[0041] H316, discretizing the time interval to obtain the frequency distribution.
[0042] Divide the time interval into multiple intervals (e.g., group by hour, day, week), and count the frequency of intervals in each interval. Convert continuous numerical values to discrete distribution to simplify data structure and facilitate statistical analysis of regular patterns (e.g., whether high-frequency intervals correspond to periodic travel).
[0043] H317, obtaining HD2 according to the frequency distribution.
[0044] HD2 can be measured by the concentration of frequency distribution (e.g., peak frequency, entropy value). For example, if most of the time intervals are concentrated in a certain interval (e.g., travel at 8am every day), HD2 is high, indicating that the travel pattern is obvious.
[0045] Through this step, the regularity of user travel time is quantified, providing a key indicator for determining whether the user is a long-term (regular) or short-term (irregular) user.
[0046] H320, if HD1≥HD1' and HD2<HD2', use the first feature extraction method to extract the feature vector of HA to obtain HX; wherein HD1' is a preset structure complexity threshold, and HD2' is a preset regularity threshold.
[0047] Further, the first feature extraction method for extracting the feature vector of HA includes the following steps:
[0048] H321, converting HA into a heterogeneous graph structure to obtain the corresponding heterogeneous travel task knowledge graph HB of HA; wherein the node types of HB include departure location, destination, and start time, and the edge types include time sequence and the association between departure location and destination.
[0049] The node types of HA are explicitly divided into three categories: departure place, destination, and start time. The edge types are defined as time sequence (e.g., t1→t2) and place association (e.g., departure place→destination), and a heterogeneous travel task knowledge graph HB is generated.
[0050] The heterogeneous graph can explicitly represent the semantic relationships of different types of nodes and edges, which facilitates the subsequent neural network to capture multi-dimensional associations (e.g., the cross-influence of place and time).
[0051] H322 uses a graph attention neural network to encode HB and learns the importance weights of different types of nodes and edges through a multi-head attention mechanism to generate node embedding vectors.
[0052] Through the multi-head attention mechanism, the model learns the importance weights of different types of nodes and edges to generate node embedding vectors containing semantic and structural information.
[0053] The graph attention neural network (GAT) can adaptively focus on key nodes (e.g., high-frequency travel places) and edges (e.g., frequently occurring time intervals), improving the relevance and efficiency of feature extraction.
[0054] H323 concatenates all node embedding vectors in chronological order and calculates the context weights of each node through a self-attention mechanism to obtain a historical travel task feature vector HX.
[0055] All node embedding vectors are concatenated in chronological order, and the context weights of each node in the sequence are calculated through a self-attention mechanism to generate the final feature vector HX.
[0056] Combining the chronological order and context relationship, the time sequence dependence of the travel task (e.g., the influence of the previous travel on the next one) is captured, making HX more comprehensive representation of the travel pattern.
[0057] H330, if HD1<HD1' and HD2≥HD2', a second feature extraction method is used to extract feature vectors from HA to obtain HX.
[0058] Further, the use of the second feature extraction method to extract feature vectors from HA includes the following steps:
[0059] H331, the time information of each node in HA is periodically encoded to generate a time feature vector.
[0060] The start time is converted into a periodic feature (e.g., hours of the day, days of the week), and a time feature vector is generated through a sine / cosine function encoding to capture the time periodicity (e.g., weekday / weekend pattern).
[0061] Explicitly encode the periodicity of time, suitable for scenarios where travel time has a fixed pattern (e.g., commuters).
[0062] H332, encode the origin and destination in HA with geographic semantics, extract the semantic features of place type and latitude-longitude relationship.
[0063] Extract the type of place (e.g., residential area, commercial area) and latitude-longitude relationship, and convert geographic information into vectors through semantic embedding (e.g., Word2Vec) to capture the semantic association of places (e.g., the commuting relationship between residential areas and companies).
[0064] Combine geographic semantic information to make the model understand the functional relationship between places, rather than relying solely on original coordinates, and improve the semantic expression ability of features.
[0065] H333, tensor fusion of time feature vector, semantic feature vector and node structure feature vector, mapped to historical travel task feature vector HX through multilayer perception.
[0066] Tensor fusion of time feature vector, semantic feature vector and node structure feature (e.g., node degree), mapped to a unified feature vector HX through multilayer perception (MLP).
[0067] Integrate time regularity, geographic semantics and structure information, and provide more accurate feature representation for regularity high but structure simple graphs (e.g., fixed route commuting).
[0068] H340, if HD1≥HD1' and HD2≥HD2', use the first feature extraction method and the second feature extraction method to extract the feature vector of HA, and obtain HX.
[0069] Further, step H340 includes the following steps:
[0070] H341, use the first feature extraction method to extract the feature vector of HA, and obtain the first intermediate feature vector HX1.
[0071] H342, use the second feature extraction method to extract the feature vector of HA, and obtain the first intermediate feature vector HX2.
[0072] Generate HX1 (focus on structure and heterogeneous graph relationship) and HX2 (focus on time and semantic regularity) according to the methods of H320 and H330; use the advantages of the two methods to handle complex structures and regular patterns, and avoid the limitations of a single method.
[0073] H343, fusing HX1 and HX2 to obtain HX=δ1×HX1+δ2×HX2; wherein, δ1 and δ2 are weights corresponding to the first feature extraction method and the second feature extraction method respectively; δ1+δ2=1.
[0074] In this embodiment, the weights can be dynamically adjusted according to the graph characteristics, such as δ1 being larger when the structure is complex.
[0075] Adaptive balancing of the influence of structural complexity and temporal regularity enables HX to simultaneously represent diversified scenarios and periodic patterns, thereby improving the robustness of subsequent prediction.
[0076] By quantifying the graph characteristics through HD1 and HD2, the feature extraction method is dynamically selected to adapt to different user travel patterns (such as regular commuting users vs. random travel users); the heterogeneous graph and GAT capture the structural association of the graph, and the geographic semantic encoding and temporal periodicity encoding strengthen semantic understanding, thereby improving the expression ability of the features; according to the graph complexity and regularity, multiple feature extraction methods are dynamically fused to ensure that HX can comprehensively represent user travel behavior and provide more accurate input for destination prediction.
[0077] H400, inputting HX into a preset user type classification model to determine whether the user corresponding to the target user ID is a long-term user or a short-term user; wherein, the long-term user is a user whose travel behavior forms a periodic regularity, and the short-term user is a user whose travel behavior does not form a periodic regularity.
[0078] In this embodiment, the preset user type classification model is a trained model that can accurately distinguish between long-term users and short-term users; the long-term user has stable travel intervals (such as fixed time travel every week / month) and high destination repetition rate; the short-term user has random travel time and scattered destinations (such as tourism users).
[0079] Different prediction algorithms are used for different user types (such as long-term users relying on periodic regularity and short-term users relying on real-time preference); this avoids overfitting historical data for short-term users and improves prediction efficiency.
[0080] H500, if the user corresponding to the target user ID is a long-term user, the time period corresponding to the earliest start time and the latest start time in the historical travel tasks of the target user ID is determined as the target time period.
[0081] For long-term users, the interval between the earliest and latest travel times is used as the target time period. For example, a user has fixedly traveled between City 1 and City 2 on the 15th of each month in the past 12 months, and the target time period is from January 15, 2024 to December 15, 2024.
[0082] Directly determine the prediction range based on historical cycles, simplify calculations (e.g., predict the destination for the 15th of next month as City 2); stability guarantee: reduce the interference of short-term fluctuations on prediction (e.g., a temporarily canceled single trip does not affect the overall cycle).
[0083] H600, if the user corresponding to the target user ID is a short-term user, determine the target time period corresponding to the target user ID according to HA.
[0084] For short-term users, dynamically determine the target time period according to HA. For example: based on the last trip (e.g., the user just arrived from City 1 to City 2, predict the return trip in the next 7 days); combined with external events (e.g., during the international conference in City 2, extend the prediction window).
[0085] Further, step H600 includes the following steps:
[0086] H610, calculate the time distribution density of the nodes in HA, generate the probability density function f(t) on the time axis by kernel density estimation; t is time.
[0087] Kernel density estimation (KDE) is a non-parametric statistical method that estimates the probability density of time data by placing kernel functions (such as Gaussian kernel) at each time point and weighted summation, and smoothing. Specifically, for the start time of each node in HA, KDE will calculate the density value of each point on the time axis according to the preset bandwidth parameter, and finally generate a continuous probability density function f(t). This function reflects the probability distribution of user travel at different time points, and the higher the density, the more concentrated the travel.
[0088] Through this step, the original time data is smoothed, the randomness of discrete time points is eliminated, and the real travel time aggregation pattern is highlighted; without assuming a priori model of time distribution (such as normal distribution), it is more adaptable and can capture complex time distribution characteristics (such as multi-peak distribution); provides a continuous density distribution basis for subsequent time cluster identification, improves the accuracy of time pattern recognition.
[0089] H620, identify the peak area in f(t), define the continuous time period with density value higher than the preset density threshold as the target density time cluster.
[0090] First, detect the local maximum (peak) in f(t), which corresponds to the time period with high travel frequency. Then set a density threshold, and divide the continuous time period with density higher than the threshold into a "target density time cluster". For example, if f(t) has a density continuously higher than the threshold at 9:00-11:00 and 18:00-20:00, these two intervals will be defined as time clusters respectively.
[0091] Through this step, the core time period of user activity is automatically screened out, the sporadic time points of low-frequency travel are excluded, and the key travel period is focused. The noise is filtered through the density threshold to ensure that the time cluster represents statistically significant travel rules rather than accidental behavior. Data-driven time mode division is provided for short-term users (without periodic rules) to make up for the lack of prior rules.
[0092] H630, if the number of target density time clusters is greater than 1, select the time cluster containing the last HN travel tasks as the candidate target time period.
[0093] When there are multiple time clusters (such as two clusters of morning and evening peak on weekdays), the time cluster containing the last HN travel tasks is preferentially selected. HN is a preset parameter (such as HN=5), indicating that only the time cluster to which the last HN travel tasks belong is focused. For example, if the last 5 travel tasks of the user are concentrated in the evening peak time cluster, the cluster becomes the candidate.
[0094] The travel behavior of short-term users may change over time (such as temporary job changes), and the recent travel can better reflect the current demand, improving the timeliness of the time period; avoid selecting irrelevant historical patterns in multiple time clusters (such as the user's previous commuting pattern has changed), and ensure that the candidate time period is highly related to the current behavior; the sensitivity to recent behavior can be flexibly adjusted through the HN parameter to adapt to the needs of short-term users in different scenarios.
[0095] H640, the boundary of the candidate time period is expanded, including: extending τ1 time units forward to include the potential preparation stage, and extending τ2 time units backward to cover the possible travel continuation.
[0096] Taking the starting point of the candidate time period as the benchmark, τ1 (such as 30 minutes) is extended forward to cover the "preparation stage" (such as the user's preparation time before departure), and τ2 (such as 1 hour) is extended backward to cover the "travel continuation stage" (such as the activity time after arriving at the destination). For example, the candidate time period is 18:00-20:00, τ1=30 minutes, τ2=1 hour, then the extended time period is 17:30-21:00.
[0097] The limitation of the original time period only containing the "departure time" is made up, the context time related to travel (preparation, continuation) is considered, and the time period is made more complete; the time relevance of the subsequent knowledge graph HZ is improved, for example, the extended time period may contain more pre or post tasks related to travel, enhancing the prediction basis; τ1 and τ2 can be dynamically adjusted according to historical data (such as τ1=15 minutes in the commuting scenario and τ1=2 hours in the tourism scenario), improving the adaptability in different scenarios.
[0098] H650, if the extended time period contains the current time point, the extended time period is determined as the target time period; otherwise, the future time period closest to the current time is selected as the target time period.
[0099] Firstly, it is judged whether the extended time period contains the current time (for example, the current time is 18:15, and the extended time period is 17:30-21:00, which contains). If it contains, it is directly used as the target time period. If it does not contain (for example, the extended time period is 9:00-11:00, and the current time is 16:00), the future time period closest to the current time is selected from all future time periods (for example, the next day 9:00-11:00).
[0100] The real-time relevance of the target time period and the current time is ensured, the travel prediction of the "upcoming" is focused on, and the attention to the historical time period that has expired is avoided. For the case without current time coverage, the nearest future time period is selected preferentially, the forward-looking and practicality of the prediction is ensured, and the characteristics of the "instant travel" of the short-term user are met. The real-time demand of the user is dynamically adapted, for example, when the user plans to travel temporarily, the system can quickly locate the nearest potential travel time period, and the prediction efficiency is improved.
[0101] In the above steps, the target time period is dynamically determined for the short-term user through the process of "density estimation→peak identification→recent screening→boundary expansion→real-time matching". The method is based on data driving rather than preset rules, and is suitable for the travel mode without periodicity. The time density and recent behavior are combined, the historical mode and real-time demand are balanced, the boundary expansion and real-time matching mechanism are used to enhance the integrity and prediction timeliness of the time period, and finally the accurate time range is provided for the construction of the knowledge graph HZ, and the accuracy of the destination prediction is improved.
[0102] H700, obtaining a plurality of historical task information of different types corresponding to the target user ID in the target time period to generate the knowledge graph HZ corresponding to the target user ID.
[0103] In this embodiment, after the target time period corresponding to the target user ID is obtained, a plurality of historical task information of different types corresponding to the target user in the target time period can be obtained, and then the knowledge graph generation method in embodiment three is used to generate the knowledge graph HZ corresponding to the target user ID.
[0104] H800, predicting the destination corresponding to the target user ID according to the HZ.
[0105] In this embodiment, it should be noted that the person skilled in the art can use the existing method for predicting the destination based on the knowledge graph according to the actual need to predict the destination corresponding to the target user ID according to the HZ, and no further description is given here.
[0106] In this embodiment, first, the user travel task knowledge graph is constructed, the user historical travel information is systematically integrated, and the complex travel data is converted into structured knowledge. On this basis, the feature vector is extracted and the user type is classified, the long-term user and the short-term user are accurately identified, the target time period determination strategy is formulated for different types of users, and then the multi-type historical task information in the target time period is integrated to generate a new knowledge graph, and the potential travel mode of the user is fully mined. Compared with the traditional scheme, this method effectively solves the prediction problem of insufficient data of short-term users and difficult extraction of features in the civil aviation field, while taking into account the regularity mining of long-term users, greatly improving the accuracy and timeliness of destination prediction for different user types.
[0107] Embodiment two:
[0108] A user knowledge graph generation system will be introduced below, which comprises a processor, a knowledge graph generation module, an entity library, a relationship library, an information query rule library, a plurality of task ports and a plurality of information query ports; wherein the entity library comprises a plurality of preset entities, the relationship library comprises relationships between entities, the information query rule library comprises a plurality of information query rules, and each information query rule corresponds to a task.
[0109] In this embodiment, the entity library can be understood as an entity set, and the entity can be a flight, an airport, a ticket, etc.; the relationship library is a set of relationships between entities, and the relationship between entities can be an undirected and weightless relationship, a directed and weighted relationship, or a directed and weightless relationship, etc.; the information query rule library is a mapping table of task types and query rules, and different task types correspond to different query rules; for example: the task type is flight delay prediction, and the corresponding query rule is as follows:
[0110] {"data source": "flight dynamic database", "condition": "same route flight in the past 7 days"};
[0111] {"data source": "weather API", "condition": "weather in the next 24 hours at the departure airport"};
[0112] {"data source": "user historical preference", "condition": "on-time rate of regular flights"}.
[0113] The task port is a port for receiving knowledge graph generation requests from external business systems, such as APP, management system, etc.; the information query port is an interface for connecting different data sources, such as SQL query interface, API interface, message queue, etc.
[0114] The processor is used to perform the following steps:
[0115] S100, acquiring a knowledge graph generation instruction sent by a task port; the knowledge graph generation instruction comprises a target user ID and a target task.
[0116] The processor listens to the request of the task port, and parses out the target user ID and the target task type; civil aviation example: a passenger initiates a "generate route preference knowledge graph of place 1-place 2" request through a preset APP, and the instruction contains: target user ID: U1024 (Zhang San) target task: "route preference analysis".
[0117] S200, according to the target task, determining the target information query rule corresponding to the target task from the information query rule library.
[0118] According to the task type, the predefined query rule set is retrieved and matched.
[0119] Further, step S200 includes the following steps:
[0120] S210, according to the task type of the target task, performing one-level index matching in the information query rule library to obtain a candidate information query rule set associated with the task type.
[0121] Further, step S210 includes the following steps:
[0122] S211, performing semantic similarity calculation on the task type of the target task and the rule label in the information query rule library.
[0123] In this embodiment, the task type of the target task, such as "route preference analysis", is calculated with the semantic similarity of the label of each rule in the information query rule library, such as "historical flight analysis", "passenger preference mining", etc. The word vector model in natural language processing, such as BERT or the semantic distance algorithm based on the task type hierarchy, can be used to measure the semantic association degree of the task type and the rule label; it should be noted that those skilled in the art can use existing semantic similarity calculation methods to calculate the semantic similarity of the task type of the target task and the rule label in the information query rule library according to actual needs, which will not be described here.
[0124] S212, determining the rule with a semantic similarity greater than a first preset similarity threshold as a candidate information query rule.
[0125] In this embodiment, the first preset similarity threshold is set, for example, 0.7, and the rules with a calculated semantic similarity greater than the threshold are selected to form a candidate information query rule set. For example, the target task is "flight delay prediction", and the semantic similarity with the rules such as "flight delay analysis based on weather data" and "historical delay data association prediction" is higher than the threshold, so these rules will be selected into the candidate set.
[0126] The first-level index matching is performed through semantic similarity calculation, which changes the limitation of traditional simple keyword matching, can mine rules with similar semantics but different expressions, expands the rule screening range, avoids missing key rules due to differences in task type expression, improves the comprehensiveness and relevance of the candidate rule set, and lays a foundation for subsequent accurate determination of target rules.
[0127] In S220, additional parameters in the knowledge graph generation instruction are parsed, and the additional parameters include at least one of a user portrait label, a task line identifier, and a data sensitivity level.
[0128] In this embodiment, the additional parameters contained in the knowledge graph generation instruction are extracted and parsed. The user portrait label reflects the characteristic attributes of the user, such as “business traveler” and “frequent traveler”; the task line identifier is used to distinguish tasks of different business lines, such as “domestic flight business line” and “international flight business line”; and the data sensitivity level indicates the sensitivity of the data, such as “public data” and “internal sensitive data”. For example, the additional parameters in the instruction show that the user portrait label is “business traveler”, the task line identifier is “international flight business line”, and the data sensitivity level is “internal sensitive data”.
[0129] Parsing the additional parameters enables the system to obtain more background and constraint information of the task, which will play a key role in subsequent rule screening, so that the determined target information query rule not only meets the task type requirements, but also meets the requirements of business scenarios and data security, etc., and improves the fit degree of the rule and the actual business requirements.
[0130] In S230, based on the additional parameters, a second-level screening is performed on the candidate information query rule set to determine a target information query rule that meets all the constraint conditions.
[0131] In this embodiment, the additional parameters parsed are used to evaluate each rule in the candidate information query rule set. It is checked whether the rule meets the requirements corresponding to the user portrait label, such as whether the rule for business travelers contains high-end cabin analysis content, whether it belongs to the specified task line identifier range, and whether it meets the access authority of the data sensitivity level, such as whether the rule with a sensitivity level of “internal sensitive data” has the corresponding data access authorization configuration. Only the rule that fully meets all the constraint conditions of the additional parameters can be determined as the target information query rule. For example, in the candidate set, a rule that contains business traveler-related analysis content, is applicable to the international flight business line, and has internal sensitive data access authority is selected as the target information query rule.
[0132] The secondary screening is based on additional parameters to accurately filter the rules from the candidate rule set that best meet the actual business requirements, avoid using rules that do not meet the business scenarios or violate data security regulations, ensure that the data and analysis logic for generating the knowledge graph are accurate and compliant, and improve the quality and usability of the generated knowledge graph.
[0133] In S240, if there are multiple target information query rules that meet the conditions, a rule with the highest execution priority is selected according to a preset rule priority strategy.
[0134] When there are multiple target information query rules that meet the conditions after the secondary screening, a rule is selected according to a preset rule priority strategy. The priority strategy can be set according to factors such as the importance of the business, the timeliness of the rule, and the scope of the rule. For example, the priority of a rule related to an urgent business requirement is set to the highest; for the same task type, a newly released rule has a higher priority than an old rule; and a rule with a wider scope has a higher priority. By comparing the priorities of multiple rules, a rule with the highest execution priority is selected for subsequent knowledge graph generation.
[0135] This step solves the problem of selecting multiple rules that meet the conditions, avoiding the uncertainty of rule selection that leads to chaotic knowledge graph generation logic. Based on a scientific priority strategy, the system can prioritize rules that best meet the current business needs and values, improving the efficiency and business relevance of knowledge graph generation, and making the generated knowledge graph better serve actual business scenarios.
[0136] In S300, target information corresponding to a target user ID is obtained from an information query port corresponding to a target task according to a target information query rule, wherein the target information includes a plurality of historical task information corresponding to the target user ID and related to the target task.
[0137] Further, step S300 includes the following steps:
[0138] In S310, the data source configuration in the target information query rule is parsed to determine a set of information query ports to be accessed, and the set of information query ports includes at least one of an internal database port, an external API port, and a real-time data stream port.
[0139] In this embodiment, the data source configuration specified in the target information query rule is parsed to identify the information sources that need to be accessed to complete the query. For example, the rule may include configurations such as data source: flight dynamic database, data source: weather API, data source: real-time flight delay data stream, etc. According to different data source types, the corresponding information query port that needs to be accessed is determined. The internal database port is used to access enterprise internal storage data, such as the flight booking database. The external API port is used to call external service interfaces, such as the meteorological service API. The real-time data stream port is used to obtain real-time updated data, such as airport real-time flight status stream data. Through parsing, the relevant ports are combined into an information query port set. For example, for the target information query rule of the "flight delay prediction" task, the information query port set determined after parsing may include the internal flight dynamic database port, the external weather API port, and the real-time flight delay data stream port.
[0140] The correspondence between the data source and the information query port is clear, so that the system can quickly locate and prepare the data acquisition channel. This avoids data acquisition confusion or errors caused by unclear data sources, improves the relevance and efficiency of data acquisition. At the same time, it supports multiple types of data source ports, enabling the system to integrate internal and external, static and dynamic, and other multi-dimensional data, enhancing the richness and comprehensiveness of the knowledge graph data.
[0141] S320, based on the query parameter template in the target information query rule, and in combination with the target user ID and additional parameters, a structured query statement is generated.
[0142] In this embodiment, according to the query parameter template in the target information query rule, in combination with the target user ID and additional parameters such as user portrait labels, task line identifiers, data sensitivity levels, etc., a structured query statement that meets the query specifications of each data source is generated.
[0143] The query parameter template defines the conditions and parameter formats required for the query. For example, the template may require querying "flight booking records of users who belong to a certain task line and have a certain user portrait label within the past 7 days." The target user ID is filled into the user-related parameter position, and the task line, user portrait, etc. conditions are supplemented according to the additional parameters to form a complete query statement. For example, for a SQL database, a standard SQL query statement is generated; for an API interface, a request parameter combination that meets the interface call specifications is generated. If the target user ID is U1024, the additional parameters show that the user portrait label is "business traveler" and the task line identifier is "international flight business line", in combination with the query parameter template, the generated SQL query statement may be "SELECT FROM flight_booking WHERE user_id='U1024' AND user_profile_label='business traveler' AND task_line_identifier='international flight business line' AND booking_time >= CURDATE() - INTERVAL 7 DAY.
[0144] The generation of the structured query statement ensures the standardization and accuracy of data queries, enabling the system to effectively interact with different types of data sources. Combined with the target user ID and additional parameters, it can accurately filter data highly relevant to the target task, avoiding the acquisition of irrelevant data, reducing data processing volume, and improving data acquisition efficiency. At the same time, this parameterized query method also enhances the flexibility of the system, making it easier to adapt to changes in different tasks and user needs.
[0145] S330, send the structured query statement to each information query port to obtain a number of historical task information corresponding to the target user ID and related to the target task.
[0146] In this embodiment, the generated structured query statement is sent to each port in the information query port set. After receiving the query statement, each port performs a query operation in the corresponding data source and returns the query result. The internal database port retrieves data in the internal database, the external API port sends a request to an external service to obtain data, and the real-time data stream port filters data that meets the conditions from the real-time stream. Finally, the system integrates the results returned by each port to obtain a number of historical task information corresponding to the target user ID and related to the target task.
[0147] For example, the historical flight booking records of the user are obtained from the flight booking database port, the weather data corresponding to the flight date is obtained from the weather API port, and the real-time delay information of the flight is obtained from the real-time data stream port. These data are aggregated into a complete set of historical task information.
[0148] By sending query statements to multiple information query ports in parallel, concurrent acquisition of multi-source data is achieved, significantly shortening the data acquisition time and improving the overall data acquisition efficiency. Integrating data from different sources makes the acquired historical task information more comprehensive and rich, providing an adequate and accurate data foundation for subsequent knowledge graph generation, which helps to generate high-quality, detailed content knowledge graphs, better serving business analysis and decision-making.
[0149] S400, send the target information to the knowledge graph generation module;
[0150] The knowledge graph generation module is configured to perform the following steps:
[0151] S500, determine, according to each historical task information, a plurality of entities corresponding to each historical task information from an entity library, to obtain a plurality of entities corresponding to the target user ID and related to the target task.
[0152] Further, step S500 includes the following steps:
[0153] S510, parse the entity identification field in the historical task information, and map the field value of the entity identification field to an entity identification in the entity library based on an entity mapping rule in the target information query rule.
[0154] The entity identification field is extracted from the historical task information, such as "flight number" and "passenger name", and the field values are converted to the corresponding standard entity identification in the entity library according to the pre-defined entity mapping rule in the target information query rule. For example, the "CAXXXX" flight number in the historical task information is mapped to the "flight CAXXXX" entity with ID "E0003" in the entity library through the mapping rule; the user name "Zhang San" is mapped to the "passenger Zhang San" entity with ID "U1234". The mapping rule can be a one-to-one fixed mapping table, or a complex conversion logic based on a rule engine, such as converting abbreviations and aliases to standard names.
[0155] Through this step, the unified association of data fields and standard entities is realized, the confusion of entity recognition caused by data expression differences such as abbreviations and aliases is eliminated, and the accuracy and consistency of entity construction in the knowledge graph are ensured. At the same time, through the pre-defined mapping rule, the cost of manual annotation is reduced, the efficiency of entity processing is improved, and a standardized data foundation is provided for subsequent graph construction.
[0156] S520, perform a three-level matching strategy on the mapped entity identification, the three-level matching strategy including: directly locating the corresponding entity in the entity library through the entity ID; for text description without explicit ID, calling an NLP model to identify the entity type and name, and searching the entity library through semantic similarity; for records only with associated information, tracing back to the target entity through the association relationship chain.
[0157] In this embodiment, the first-level matching is ID direct positioning: for data containing explicit entity ID, such as "passenger ID: U1234", the corresponding ID entity is directly searched in the entity library to quickly obtain complete entity information, for example, "U1234" is directly positioned to the detailed information of "passenger Zhang San".
[0158] The second-level matching is NLP semantic retrieval: for a text description without a clear ID, such as "flight from city 1 to city 2", a natural language processing (NLP) model such as BERT or GPT is called to analyze the text semantics, identify the entity type (flight) and key attributes (departure city and destination city), and then retrieve the matching entity in the entity library by calculating the semantic similarity. For example, the text is compared with the name and route information of the flight entity in the entity library to find the most similar flight entity.
[0159] The third-level matching is relationship chain tracing: if the record only contains association information with other entities, such as "the frequent flight route of this passenger", the predefined relationship chain in the relationship library, such as "passenger-frequent flight route-flight", is used to trace the target entity step by step from the known associated entity. For example, multiple flight entities corresponding to "passenger Zhang San" are found through the "frequent flight route" relationship.
[0160] The third-level matching strategy forms a complete entity matching system from accurate to fuzzy and from direct to indirect, covering various complex data scenarios. Whether it is structured ID data, unstructured text data, or associated data, it can efficiently and accurately match the corresponding entity in the entity library, significantly improving the coverage and accuracy of entity recognition, avoiding entity omission or incorrect matching, and ensuring the integrity of the knowledge graph entity.
[0161] S530, performing attribute completion operation on the matched entity.
[0162] For the matched entity, check if the attribute information is complete. If there are missing attributes, according to the entity type and target task requirements, supplement the attribute values from related data sources or default rules. For example, for "flight CAXXXX" entity, if the model information is not included in the historical task information, query and complete the "model: B787" from the flight basic information database; if the entity lacks common attributes such as creation time and update time, fill in the current time or standard default value according to the system default rules.
[0163] Through this step, it is ensured that each entity in the knowledge graph has complete and accurate attribute information, avoiding incomplete graph information or analysis bias due to missing attributes. Complete attribute data provides more rich information support for subsequent entity relationship analysis and knowledge reasoning, improving the application value and analysis depth of the knowledge graph. For example, in flight delay prediction, complete model, historical on-time rate, etc. attributes help to more accurately model and predict.
[0164] S540, applying entity deduplication and merging rules to aggregate multiple records of the same entity to obtain the entity set of the target user, which includes the unique identifier, type and attribute set of each entity.
[0165] The pre-defined entity de-coincidence merging rule is applied to process multiple records of the same entity. By comparing the unique identifier, key attributes such as name, type, core ID of the entity, it is determined whether the records belong to the same entity. If they are the same entity, the attributes of the multiple records are aggregated, the valid attribute values are retained and the conflicting attributes are merged, such as taking the latest time, the highest priority value. For example, if there are two records of "passenger Zhang San", one contains the contact information and the other contains the membership level, the complete "passenger Zhang San" entity record containing the contact information and the membership level is formed after merging, and the entity set of the target user is finally generated.
[0166] Through this step, duplicate entity data is eliminated, redundant nodes in the knowledge graph are avoided, the graph structure is more concise and clear, and the data storage and computing costs are reduced. At the same time, through attribute aggregation, the comprehensiveness and accuracy of entity information are ensured, the quality of the knowledge graph is improved, and subsequent operations such as query, analysis and recommendation based on the graph are efficiently performed, for example, in user portrait construction, accurately aggregated entity information can more truly reflect user characteristics.
[0167] S600, according to the relationship database, determining the relationship between the several entities corresponding to the target user ID.
[0168] Further, step S600 includes the following steps:
[0169] S610, parsing the entity set of the target user, mapping user behavior to a pre-set relationship type based on the behavior records in the historical task information.
[0170] The system parses the entity set of the target user, such as "passenger Zhang San", "flight CAXXXX", "city 1 capital international airport", etc., and analyzes the behavior records in the historical task information, such as "on October 1, 2024, Zhang San booked CAXXXX flight" and "CAXXXX flight took off from city 1 capital international airport on the same day". Based on the pre-set mapping rules, these behavior records are converted into pre-set relationship types. For example, the "booking" behavior corresponds to the "passenger booking flight" relationship type, and the "takeoff" behavior corresponds to the "flight taking off from the airport" relationship type. These mapping rules can be defined and optimized by domain expert knowledge or machine learning algorithms.
[0171] Through this step, user behavior is standardized into a unified relationship type, solving the problem of ambiguous relationship definition caused by the diversity of behavior expressions, ensuring the standardization and consistency of relationship expression in the knowledge graph. Through the pre-set mapping rules, automatic identification of relationship types is realized, greatly reducing the cost of manual annotation and improving the efficiency of relationship construction, providing a reliable foundation for subsequent analysis based on the relationship network.
[0172] S620, determine the starting entity and the target entity of the relationship according to the subject and the object of the behavior.
[0173] According to the mapped relationship type, the starting entity and the target entity of the relationship are determined in combination with the subject and object information in the behavior record. In the behavior record of "Zhang San booking CAXXXX flight", "passenger Zhang San" as the subject of the behavior is the starting entity of the relationship; "flight CAXXXX" as the object of the behavior is the target entity of the relationship. For a bidirectional relationship, such as "passenger Zhang San and passenger Li Si travel together", the two entities can be mutually starting and target entities; for a unidirectional relationship, such as "flight CAXXXX takes off at city 1 capital international airport", "flight" is the starting entity and "airport" is the target entity.
[0174] S630, determine the weight value of each relationship according to the time, behavior type and co-occurrence frequency corresponding to the relationship between the starting entity and the target entity.
[0175] In this embodiment, for the relationship between each group of starting entity and target entity, the weight value is determined by comprehensively considering the time, behavior type and co-occurrence frequency corresponding to the relationship. In terms of time factor, the behavior occurring recently is given higher weight, such as the flight booking behavior occurring yesterday is higher than the weight of the behavior half a year ago; in terms of behavior type, the important behavior, such as "buying first class ticket", is higher than the weight of the ordinary behavior, such as "inquiring flight information"; the co-occurrence frequency reflects the closeness of the relationship between entities, and Zhang San and a flight frequently produce booking behavior, so the weight of the "booking" relationship is higher. The weight can be calculated by a weighted formula, such as: weight = SY1 x time weight + SY2 x behavior type weight + SY3 x co-occurrence frequency weight; SY1, SY2 and SY3 are weight coefficients set according to business requirements.
[0176] Through this step, multi-dimensional factors are introduced to determine the relationship weight, so that the relationship network in the knowledge graph has more hierarchical and dynamic, which can reflect the real strength and importance of the relationship between entities. The weighted relationship network provides more rich information for data analysis, for example, in flight recommendation, the high weight "booking" relationship can be used as the basis for priority recommendation, which improves the accuracy and business value of recommendation.
[0177] S640, merge the same type of relationship between the same entity pairs and accumulate the weight values to obtain the relationship set of the target user.
[0178] In this embodiment, all relationships can be traversed, and for the same type of relationship between the same entity pair, such as multiple "reservation" relationships generated by Zhang San's multiple reservations of CAXXXX flights, the relationships are merged and the weight values are accumulated. The merged relationship retains the starting entity, target entity, relationship type, and accumulated weight information, and finally forms the relationship set of the target user. For example, Zhang San reserved CAXXXX flights three times in a month, and the "reservation" relationship weight generated by each reservation behavior is 0.3, 0.4, and 0.3, respectively. After merging, the weight of the "reservation" relationship is 1.0.
[0179] Through this step, redundant information in the relationship network can be eliminated, the knowledge graph structure can be simplified, and the data storage and calculation costs can be reduced. The accumulated weight value makes the expression of relationship strength more accurate, highlights important relationships between entities, and facilitates subsequent sorting, screening, and analysis based on relationship weights, such as quickly identifying the closest relationship between a user and a specific entity, providing strong support for personalized services and accurate task recommendations.
[0180] S700, generating a knowledge graph corresponding to the target user ID according to a plurality of entities corresponding to the target user ID and relationships between the entities.
[0181] Further, step S700 can include the following steps:
[0182] S710, encapsulating the entity set and the relationship set of the target user in a format supported by the knowledge graph generation module to generate a standard graph data structure.
[0183] In this embodiment, the entity set and the relationship set of the target user are standardized and encapsulated in a format supported by the knowledge graph generation module. For example, in the civil aviation scenario, the entity "passenger Zhang San" and "flight CAXXXX", and the relationship "reservation" need to be converted into a graph database, such as a node and edge structure supported by Neo4j. Specifically, a unified graph data model is defined, and the attributes and data types of nodes and edges are clearly defined; the entities and relationships are serialized to ensure that the data format meets the interface requirements of the generation module.
[0184] Through this step, the format differences of different data sources are eliminated, ensuring that the entity and relationship data are input into the generation module in a unified format, improving system compatibility and maintainability; the pre-encapsulated standard structure reduces the parsing time of the generation module.
[0185] Further, step S710 includes the following steps:
[0186] S711, converting the entity into a node object, the node object including a unique ID, a type, and an attribute set.
[0187] In this embodiment, each entity is mapped to an independent node object, including three core attributes:
[0188] Unique ID: such as "U1024" (entity ID of passenger Zhang San), ensuring the uniqueness of nodes in the graph.
[0189] Type: such as "passenger", "flight", "airport", facilitating subsequent filtering and analysis by type.
[0190] Attribute set: encapsulating the specific characteristics of entities, for example, the "passenger" node contains attributes such as name, membership level, and historical flight frequency.
[0191] The structured definition of type and attribute makes the semantics of nodes clear, facilitating graph query and knowledge reasoning; the mandatory unique ID and type avoid missing entity information, for example, ensuring that each "flight" node contains flight number and departure / arrival time attributes.
[0192] S712, convert relationships to edge objects, which include start node ID, target node ID, relationship type, weight, and timestamp.
[0193] Convert the relationship between entities into a directed edge object, containing five core fields:
[0194] Start node ID: such as "U1024", representing passenger Zhang San;
[0195] Target node ID: such as "FLT_CAXXXX" representing flight CAXXXX;
[0196] Relationship type: such as "BOOKED" representing the booking relationship;
[0197] Weight: according to the calculation result of S630, such as "0.8", indicating high-frequency booking behavior;
[0198] Timestamp: records the time when the relationship occurs, such as "2024-10-01T08:30:00".
[0199] The introduction of timestamp and weight makes the relationship have time dimension and strength difference, supporting time series analysis; the definition of directed edge and type supports multi-dimensional relationship expression, for example, "flight departs from airport" (one-way edge) and "passengers travel together" (two-way edge) can be modeled uniformly.
[0200] S720, call the interface of the knowledge graph generation module, pass the standard graph data structure to generate the corresponding knowledge graph.
[0201] Pass the encapsulated node and edge data to the knowledge graph generation module through the standardized interface, and the generation module creates a visual graph based on the graph data structure. The interface supports parameterized configuration, for example: select the graph storage type, such as attribute graph, semantic graph; configure the graph display style, including node size, edge color changes with weight.
[0202] The interface calling mode separates the generation module from the data processing flow, facilitating independent upgrade and maintenance, such as replacing the graph database without modifying the upstream data processing logic; the generated structured graph can be directly used for business visualization (such as passenger travel relationship network) and complex analysis (such as identifying high-frequency travel patterns through graph algorithms).
[0203] Further, after step S700, the following steps are further included:
[0204] S800, in response to adding a new task port, obtaining a task RW corresponding to the new task port.
[0205] When the system detects that a new task port is accessed, such as the addition of a "low-carbon flight recommendation" business port in the civil aviation system, the processor automatically triggers the task acquisition process:
[0206] Obtain the metadata of the new task through the port registration protocol, including: task name, type, business scenario description.
[0207] Parse the task definition file transmitted by the port, such as the JSON format task description, and extract the core task identifier RW.
[0208] Through this step, the system can respond to the access of new task ports without restarting the system, for example, when the civil aviation system temporarily adds a "summer student ticket recommendation" task port during the peak season, the system can complete task identification within minutes.
[0209] Through the unified port registration protocol, the access methods of different business line tasks (such as passenger / cargo tasks) are ensured to be consistent, reducing integration complexity.
[0210] S810, obtaining a plurality of entities, relationships between entities, and information query rules XE corresponding to the RW.
[0211] Based on the task description text, such as "low-carbon flight recommendation", call the NLP model to identify potential entities ("carbon emission data" "sustainable aviation fuel") and relationships ("use fuel" "reduce emissions"); if there is a predefined task template, directly load the entity and relationship definitions from the template (such as reference industry standard ontology).
[0212] Query rule generation: according to the task requirements (such as obtaining low-carbon flight data), generate corresponding information query rules XE, for example: {"data source": ["carbon footprint database", "airline fuel report API"], "query condition": "flights with carbon emissions less than the industry average in the past 12 months"}.
[0213] By combining NLP and templates, the cost of manually defining entity relationships is reduced. Automatically extracted entity relationships can be reused in similar tasks, forming the self-evolution ability of the domain knowledge graph.
[0214] S820, adding several entities corresponding to the RW to the entity library, adding the relationship between entities to the relationship library, and adding XE to the information query rule library.
[0215] Entity library update: check if the new entity exists (e.g. "sustainable aviation fuel" in the library), if not, add complete attribute definition (e.g. fuel type, carbon emission coefficient); establish the hierarchical relationship between entities (e.g. "sustainable aviation fuel" as a subtype of "fuel").
[0216] Relationship library update: add new relationship type (e.g. "flight uses fuel"), define relationship direction (flight → fuel) and attribute (use ratio); associate existing entity relationships (e.g. establish causal relationship between "use fuel" and "reduce emissions").
[0217] Rule library update: store XE by task type, establish the mapping between "low-carbon flight recommendation" and XE; generate rule priority labels (e.g. emergency task rule priority higher than regular task).
[0218] Through the above steps, it can support zero-code deployment of new task types, for example, when the civil aviation system adds a new "international flight carbon tax calculation" task, it only needs to update the three libraries to enable it without modifying the core code.
[0219] Data consistency guarantee: through uniqueness check and hierarchical management, avoid repeated definition of entity relationships, for example, ensure that the "carbon emission data" entity has consistent attributes in different tasks.
[0220] Knowledge graph evolution: new content is automatically integrated into the existing graph system, for example, the "sustainable aviation fuel" entity can be associated with the "passenger preference analysis" task to enrich the business dimensions of the graph.
[0221] Through the dynamic updating mechanism of the three libraries, the system's support period for new business scenarios is greatly shortened; the entity relationships generated by each new task access are automatically classified and managed by the system, forming an enterprise-level knowledge middle platform, for example, airlines can accumulate aviation domain knowledge graphs in different task scenarios; the standardized three-library updating process reduces manual intervention and reduces system maintenance costs caused by task iteration.
[0222] In this embodiment, first, by determining the target information query rule from the information query rule library according to the target task, and only obtaining the target user information related to the target task, the full amount of historical task information of the user can be avoided, the data processing amount is greatly reduced, the consumption of computing resources is reduced, and the efficiency of generating the knowledge graph is improved. Secondly, the system focuses on the entities and relationships related to the target task, and the generated lightweight knowledge graph is more targeted and can accurately reflect the characteristics and needs of the user in a specific business scenario, so that the user preference can be more accurately grasped based on the knowledge graph in the civil aviation task recommendation, and the accuracy of the recommendation result is improved.
[0223] In addition, the entity library, the relationship library and the information query rule library preset in the system make the generation process of the knowledge graph more standardized and standardized, facilitate the maintenance and expansion of the system, can be connected to multiple types of tasks, and when a new task is added, only the corresponding entity, relationship and information query rule need to be added in the entity library, the relationship library and the information query rule library, and the flexibility and scalability are high.
[0224] Embodiment three:
[0225] Based on the system in embodiment two, in order to improve the generation efficiency of the knowledge graph, the steps specifically executed by the knowledge graph generation module in embodiment two are as follows:
[0226] Q100, obtaining a target user ID and a target task.
[0227] The system receives an external request, such as user query or business system call, and parses the target user ID (such as U1024) and the target task type (such as flight delay prediction) from the external request.
[0228] Q200, according to the type of the target task, determine the target knowledge graph template corresponding to the target task from the preset knowledge graph template library; wherein the preset knowledge graph template library includes a plurality of knowledge graph templates, each knowledge graph template corresponds to a type of task; the knowledge graph template includes a plurality of nodes of different types and an initial attribute set corresponding to each node, and the initial attribute set is empty.
[0229] Based on the task type, the corresponding template is matched from the preset template library. For example, the "flight recommendation" task corresponds to a template containing three types of nodes, namely passenger, flight and airport, and the initial attribute set of each node is empty (such as the passenger node contains attributes such as name, membership level, etc.).
[0230] The template unifies the graph structure of the same type of task, ensures the consistency of knowledge expression, and avoids repeated definition of nodes and relationships, thereby improving the efficiency of generating the graph.
[0231] Q300, for any node QW, according to the target user ID corresponding to a number of historical task information related to the target task, determine the entity corresponding to QW, to get the entity list corresponding to QW QA= (QA1, QA2, …, QA i , …, QA n ), i=1, 2, …, n; QA i is the i-th entity corresponding to QW, and n is the number of entities corresponding to QW.
[0232] For each node type in the template (such as passenger), extract the associated entity from the historical task information. For example, by querying the user ID for its historical flight booking records, identify the associated flight entity (such as CAXXXX, MUXXXX), and form the entity list QA.
[0233] Q400, if n=1, get the attribute value of each attribute corresponding to QA1, to get the attribute value list SA1= (SA 1,1 , SA 1,2 , …, SA 1,j , …, SA 1,m ), j=1, 2, …, m; SA 1,j is the j-th attribute value corresponding to QA1, and m is the number of attributes corresponding to QA1.
[0234] When the node corresponds to only one entity (such as the passenger node corresponds to only Zhang San), query all attribute values of the entity. For example, from the user profile, get the attribute values of Zhang San's name (Zhang San), member level (platinum card), etc., and form the attribute value list SA1.
[0235] Further, after step Q400 and before step Q500, the method can include the following steps:
[0236] Q410, if n=0, based on the historical task information corresponding to the target user ID, extract the keyword set QC related to the target task.
[0237] When the template node has no matching entity in the historical task information, the system automatically extracts the keywords in the user's historical behavior. For example, the user searches for "business class from city 1 to city 2", and extracts the keyword set QC=["city 1", "city 2", "business class"].
[0238] Through this step, the cold start problem (such as new users without historical records) is solved, and the potential interest is mined through keywords; semantic understanding is enhanced, and the extracted keywords provide a basis for subsequent semantic matching, for example, identifying the user's preference for "business class".
[0239] Q411, perform semantic matching between QC and the preset civil aviation field knowledge base to obtain a specified entity set associated with the target user ID.
[0240] Perform semantic matching between the keyword set QC and the preset civil aviation field knowledge base (such as a flight database or an airport information base). For example, "City 1" matches "City 1 First International Airport" (entity ID: AIRPORT_PEK) in the knowledge base; "Business Class" matches "Business Class" under the "Cabin Type" category (entity ID: CLASS_BUSINESS).
[0241] The semantic distance between the keyword and the knowledge base entity name can be calculated based on the word vector similarity (such as Word2Vec); combined with rule matching (such as "City 1"→"PEK" airport code mapping).
[0242] In this step, the user's colloquial keywords are converted into structured entities using the civil aviation professional knowledge base (such as "fly"→"flight"); and the entity naming is unified (such as "City 2" is always mapped to "City 2 Airport").
[0243] Q412, sort the specified entity set according to the semantic matching degree, and determine the top k specified entities with the highest matching degree as the replacement entities corresponding to QW, to obtain a replacement entity list QD corresponding to the target user ID.
[0244] Sort the candidate entities by semantic matching degree, and select the top k (such as k=3) as replacement entities. For example: "City 1 First International Airport" (matching degree 0.95); "City 1 Second International Airport" (matching degree 0.90); "City 1 Third Airport" (matching degree 0.85).
[0245] Through sorting, the most relevant entities are selected first, for example, when the user searches for "City 1 departure", the main airport is matched first; multiple replacement entities are retained to provide rich data for subsequent fusion (such as considering PEK and PKX airports).
[0246] Q413, obtain the attribute value of each attribute corresponding to each entity in QD to generate a knowledge graph branch containing replacement entities, and integrate the attribute values of each branch through weighted fusion to finally form a knowledge graph corresponding to the target user ID.
[0247] Create an independent graph branch for each replacement entity, for example: Branch 1: User→Airport of Interest→City 1 First International Airport; Branch 2: User→Airport of Interest→City 1 Second International Airport.
[0248] Weighted aggregation of attribute values of each branch, for example: airport punctuality rate: PEK (85%) weight 0.6, PKX (90%) weight 0.4 → final punctuality rate = 85% * 0.6 + 90% * 0.4 = 87%.
[0249] Through multi-branch fusion, the lack of single entity information is made up (such as referring to the flight information of multiple airports at the same time); when there are multiple possible entities, the influence of false matching is reduced through weighted fusion, and the reliability of the graph is improved.
[0250] Further, after step Q400 and before step Q500, the method can further include the following steps:
[0251] Q420, if 1 < n < NUM1, n-1 nodes of the same type connected to QW through unweighted and undirected edges are generated; wherein NUM1 is the first preset number.
[0252] Further, the value range of NUM1 is 5 to 10.
[0253] When the template node corresponds to multiple entities (1 < n < NUM1, such as NUM1 = 5), the system automatically generates n-1 nodes of the same type. For example, the airport node in the template corresponds to 3 entities (city 1, city 2, city 3), then 2 additional airport nodes are generated, forming the node group {airport 1, airport 2, airport 3}.
[0254] Through this step, information overload caused by a single node carrying too many entities is avoided, for example, multiple airports are displayed as independent nodes, improving the readability of the graph; through dynamic expansion of nodes, the diversification of entity association of different users is adapted (such as a new user may associate more airports).
[0255] Q421, each entity in QA is associated with QW and n-1 nodes of the same type connected to QW through unweighted and undirected edges in turn.
[0256] In this embodiment, nodes of the same type are associated through unweighted and undirected edges, avoiding information bias caused by node priority, for example, multiple frequent traveler airports are given equal attention; structured entity-node mapping supports fast retrieval.
[0257] Q422, each attribute and attribute value corresponding to each entity in QA is added to the initial attribute list of the corresponding node to obtain the knowledge graph corresponding to the target user ID.
[0258] Fill in the attribute value of each entity into the initial attribute set of the corresponding node. For example:
[0259] Airport 1 attributes: name = City 1 First International Airport, IATA = PEK, punctuality rate = 85%;
[0260] Airport 2 attributes: name = City 2 First International Airport, IATA = SHA, punctuality = 90%.
[0261] Ensure that the attributes of each entity are saved independently (e.g., the punctuality of different airports is not confused); improve the granularity of analysis, support more fine-grained comparative analysis (e.g., compare the punctuality of multiple airports associated with a user).
[0262] When a user is associated with a moderate number of entities, maintain the clarity of the graph through node expansion; avoid discarding valuable information due to entity quantity restrictions (e.g., multiple secondary airports associated with a user), improve data utilization; independent nodes support differentiated analysis (e.g., compare the preferences of different airports of a user), provide more rich dimensions for personalized recommendations.
[0263] Further, after step Q400 and before step Q500, the method can further include the following steps:
[0264] Q430, if n≥NUM1, determine the similarity between any two entities in QA according to the attribute overlap degree, historical co-occurrence frequency and time decay factor between any two entities in QA, to obtain the entity similarity matrix QJ corresponding to QA.
[0265] In this embodiment, when the template node corresponds to a large number of entities (n≥NUM1, such as NUM1=5), the system calculates the similarity matrix QJ between entities. The similarity is determined by the following factors:
[0266] Attribute overlap: such as two flight entities sharing the same aircraft model and departure time attributes.
[0267] Historical co-occurrence frequency: such as "CAXXXX" and "MUXXXX" are often booked by the same user.
[0268] Time decay factor: entities that co-occur recently have higher similarity (e.g., co-occurrence within 30 days corresponds to a time decay factor of 1, and co-occurrence outside 180 days corresponds to a time decay factor of 0.5). The similarity between entities is determined by weighted summation.
[0269] Through similarity calculation, complex entity relationships are simplified into matrix form, reducing the complexity of subsequent processing; the time decay factor makes the graph pay more attention to recent user behavior (e.g., seasonal changes leading to route preference shifts).
[0270] Further, step Q430 can include the following steps:
[0271] Q41, for any two entities QE1 and QE2 in QA, obtain the attribute overlap degree θ1 between QE1 and QE2; wherein θ1=NM1 / NM2; NM1 is the number of attributes that QE1 and QE2 have in common, and NM2 is the sum of the number of attributes of QE1 and QE2.
[0272] Q42, obtain the historical co-occurrence frequency θ2 between QE1 and QE2; wherein θ2=NM3 / (NM(QE1)×NM(QE2)) 1 / 2 ; NM3 is the number of times that QE1 and QE2 appear together in historical tasks, NM(QE1) is the number of times that QE1 appears alone in historical tasks, and NM(QE2) is the number of times that QE2 appears alone in historical tasks.
[0273] Q43, obtain the time decay factor θ3 corresponding to QE1 and QE2; wherein θ3=α -λ×(t1-t2) ; wherein α is a preset constant, λ is a decay coefficient preset according to the type of the task, t1 is the current time, and t2 is the time of the last co-occurrence of QE1 and QE2.
[0274] Q44, according to θ1, θ2 and θ3, determine the similarity QS(QE1, QE2) between QE1 and QE2 = ω1×θ1+ω2×θ2×θ3; wherein ω1 is the weight of the attribute overlap degree, ω2 is the weight of the product of the historical co-occurrence frequency and the time decay factor; ω1+ω2=1.
[0275] Through multi-dimensional similarity calculation, the accuracy of entity clustering is improved, for example, in the civil aviation scene, different flights of the same route can be accurately clustered to provide a more detailed user portrait for the recommendation system; redundant storage and processing of similar entities are reduced, for example, 10 domestic flights frequently booked by a user are clustered into 2 clusters, reducing the cost of graph construction; the time dynamics of user behavior are captured, making the graph more in line with the current preferences of the user, for example, when the user temporarily changes the destination, the entity similarity ranking is quickly adjusted.
[0276] Q431, according to QJ, hierarchical clustering is performed, entities with a similarity greater than a first preset similarity threshold are divided into the same cluster, and an entity cluster set QH is obtained.
[0277] Based on the similarity matrix QJ, hierarchical clustering is performed, and entities with a similarity greater than a threshold (such as 0.7) are grouped into the same cluster. For example:
[0278] Cluster 1: international flights from City 1 (CAXXXX, MUXXXX);
[0279] Cluster 2: domestic flights from City 2 (FMXXXX, MUXXX1).
[0280] Agglomerative clustering (starting with each entity in its own cluster, then merging the clusters) can be used; dynamically adjust the threshold to control the number of clusters (e.g., the final number of clusters does not exceed 3).
[0281] Similar entities are aggregated to form logically clear entity clusters (e.g., grouped by route, cabin type); reduce the number of graph nodes, for example, 20 flights associated with a user are compressed into 3 clusters, improving visualization efficiency.
[0282] Q432, for each entity cluster in QH, determine the entity with the highest comprehensive weight as the representative entity of the corresponding entity cluster; wherein the comprehensive weight is determined according to the attribute completeness and the latest active time of the entity.
[0283] For each entity cluster, the representative entity is selected by considering the following:
[0284] Attribute completeness: such as flight entities containing more fields (such as aircraft type, punctuality) are preferred;
[0285] Active time: such as booking records within the last 30 days have higher weights than earlier records.
[0286] Comprehensive weight formula: comprehensive weight = attribute completeness × (1 + time decay factor).
[0287] Through this step, it is ensured that the cluster representative entity can best reflect the commonality within the cluster (such as using “CAXXXX” to represent the “City 1-City 2 Business Class” cluster); prefer to select recent active entities to avoid recommendation bias caused by old data.
[0288] Q433, obtain the attribute value of each attribute corresponding to each representative entity to generate a knowledge graph corresponding to the target user ID.
[0289] Use the representative entity of each cluster to construct the knowledge graph, for example: node: user→booking→cluster 1 representative (CAXXXX); edge attribute: label the number of entities within the cluster (e.g., “contains 5 flights”).
[0290] Convert a large set of entities into a small number of representative nodes to maintain the readability of the graph (e.g., display more clearly on mobile devices). The analysis efficiency is improved, and the cluster-based analysis (e.g., calculating the average ticket price of “international flight clusters”) is more than 10 times faster than traversing all entities.
[0291] Further, the relationship between the two entities includes: no weight and no direction relationship, weight and direction relationship, and no weight and direction relationship.
[0292] Q500, add the attribute value of each attribute in SA1 to the initial attribute set corresponding to QW.
[0293] Fill in the entity attribute value (such as Zhang San's membership level = platinum card) into the initial attribute set of the template node. For example, the membership level attribute of the passenger node changes from null to "platinum card".
[0294] Convert the abstract template into the knowledge graph of a specific user, such as converting the "flight recommendation" template into the "Zhang San's flight recommendation" graph.
[0295] Attribute consistency: ensure that the attribute structure of all nodes of the same type is the same, facilitating subsequent unified analysis (such as batch comparison of membership levels of different users).
[0296] Q600, according to the preset relationship library, determines the relationship between the entities corresponding to any two nodes to generate corresponding relationship edges, and obtains the knowledge graph corresponding to the target user ID; the preset relationship library includes the relationship between two entities.
[0297] According to the preset relationship library, establish the association between entities. For example:
[0298] Zhang San (passenger) → booking → CAXXXX (flight);
[0299] CAXXXX (flight) → depart from → City 1 First Airport (airport);
[0300] Through pre-defined relationships (such as booking, departure), the graph has business semantics, supporting complex queries (such as "query all City 1 departure flights booked by Zhang San"); the establishment of relationship edges supports reasoning of new conclusions (such as "Zhang San may need to change flights" through "Zhang San booking CAXXXX" and "CAXXXX delay").
[0301] Through pre-defined templates, the construction time of knowledge graph is shortened from hours to seconds in traditional methods; both the uniformity of graph structure of the same task type (standardization) and the content personalization according to user historical data (such as different flight recommendation graphs for different users) are guaranteed; the separation design of template library and relationship library makes business rule changes (such as adding "carbon emission" attribute) only need to modify the template, without the need to restructure the entire system.
[0302] In this embodiment, in the civil aviation business scenario, first, according to different target task types, the adaptive template is called from the preset knowledge graph template library, which makes the basic framework of the knowledge graph match the specific needs of the civil aviation business. Then, by analyzing the historical task information associated with the target user ID, the entity corresponding to the knowledge graph node and its attribute value are accurately determined, such as based on the user's past flight booking, route preference, cabin selection and other historical data, the specific characteristics of the user in the civil aviation business are determined. The knowledge graph generated through the above steps is no longer a general content, but a customized graph that deeply matches the personalized needs of civil aviation users. With the customized knowledge graph, the civil aviation business recommendation system can more accurately capture user preferences, whether it is ticket recommendation, route planning, or additional service promotion, it can achieve high matching with user needs, effectively improving the efficiency and accuracy of civil aviation business recommendation.
[0303] Embodiment Four
[0304] Based on the methods in Embodiments Two and Three, after generating the knowledge graph corresponding to the target user ID, the following steps are provided for more accurate prediction:
[0305] G100, obtaining the initial knowledge graph GZ of the target task corresponding to the target user ID; wherein GZ includes a plurality of nodes associated with the target task corresponding to the target user ID, each node corresponds to an entity, and each entity includes a corresponding start time.
[0306] In this embodiment, the initial knowledge graph corresponding to the target user can be generated by the methods in Embodiments Two and Three, which will not be described here.
[0307] G200, if the start time of each entity in GZ is before the current time, input the feature vector corresponding to GZ into the specified task prediction model to obtain the specified task corresponding to GZ; wherein the specified task has an associated relationship with the target task; the specified task includes a corresponding start time, and the start time of the specified task is after the current time.
[0308] In this embodiment, if the start time of each entity in GZ is before the current time, it means that GZ does not contain future task information, at this time, the feature vector corresponding to GZ is input into the specified task prediction model to obtain the specified task corresponding to GZ; the specified task can be destination prediction, and the target task can be hotel prediction.
[0309] Identify the time pattern in the user's historical tasks and filter out the completed tasks as the basis for prediction; through the prediction model, the association between historical tasks and future tasks is mined to supplement the possible subsequent task scenarios of the user; inject the task prediction results of the future time dimension into the knowledge graph, and expand the time coverage range of the graph.
[0310] Further, the feature vector corresponding to the GZ is obtained by the following steps:
[0311] G210, using a preset Transformer network to extract the text modal feature corresponding to the GZ to obtain the text modal feature vector GX1 corresponding to the GZ.
[0312] The text description of the entity in the GZ (such as the task name and the entity attribute text) is encoded using the Transformer network. For example, the text “city 1 to city 2 business class flight” is input into the Transformer, and the semantic association between “business class” and “city 1 city 2” is captured through the self-attention mechanism to generate a feature vector GX1 containing context semantics.
[0313] G220, using a preset relationship-aware graph convolutional network to extract the structure modal feature corresponding to the GZ to obtain the structure modal feature vector GX2 corresponding to the GZ.
[0314] The graph structure of the GZ is encoded using a relationship-aware graph convolutional network (RGCN). For example, in the flight task graph, the nodes are “passenger”, “flight”, and “airport”, and the edges are “booking” and “departure” relationships. The RGCN aggregates neighbor node information through multiple layers of convolution while considering the relationship type of the edge (such as different relationships are assigned different weights), generating a structure modal feature GX2.
[0315] The RGCN can capture the topological relationship of the nodes in the graph (such as the triple structure of “passenger-flight-airport”), avoiding the loss of structure information in traditional methods; by weighting the relationship type (such as the “booking” relationship has a higher weight than the “query”), the feature vector is more consistent with the business logic, improving the accuracy of graph reasoning.
[0316] G230, the start time of each time node in the GZ is encoded and feature extracted to obtain the time modal feature vector GX3 corresponding to the GZ; wherein the dimensions of GX1, GX2 and GX3 are the same.
[0317] The start time of the time node (such as “2024-10-01 08:30”) is converted into a computable vector, using sine-cosine position encoding or time interval features (such as the number of hours from the current time, whether it is a weekday); the time features are extracted through a fully connected layer or a CNN to ensure that GX3 is consistent in dimension with GX1 and GX2 (such as both are 768-dimensional).
[0318] The encoded time features can reflect periodicity (such as traveling every Monday) or timeliness (such as recent tasks having higher weights), allowing the feature vector to have time dimension semantics; uniform dimension design facilitates subsequent fusion, such as the time features can be directly tensor-operated with the text and structure features.
[0319] Further, GX3 is obtained by the following steps:
[0320] G231, the original time information corresponding to each node of GZ is decomposed into five-dimensional features of absolute timestamp, relative time interval, periodicity, time window label and historical time pattern; wherein, the relative time interval is obtained by logarithmic transformation processing.
[0321] In this embodiment, the absolute timestamp: records the precise UTC time of the start of the task (such as 2024-10-01T08:30:00Z), and retains the original time scale.
[0322] Relative time interval (logarithmic transformation): calculate the time difference between the current task and the nearest historical task (such as 72 hours), and compress the large interval difference by logarithmic transformation log2(Δt+1). For example, 72 hours→log2(73)≈6.19, 144 hours→log2(145)≈7.18, which converts the linear growth of interval difference from 72→144 hours to the nonlinear growth of 6.19→7.18, highlighting the sensitivity of short intervals.
[0323] Periodicity: extract the cyclic component of time, such as: day of the week: encode “Monday” as a one-hot vector [0,1,0,0,0,0,0] or a sine-cosine vector [sin(2π×1 / 7),cos(2π×1 / 7)]; hour segment: map “08:30” to the cosine encoding of the 8th hour cos(2π×8 / 24).
[0324] Time window label: divide the time window according to civil aviation business, such as: early flights: 06:00-09:00→marked as 1, and others as 0; red-eye flights: 23:00-05:00→marked as 1, and others as 0.
[0325] Historical time pattern: identify the regularity through user historical travel data, such as: if the user has fixed travel on the 1st of each month for the past 6 months→encode as [1,0,0] (indicating “monthly fixed” mode); if the user often travels on early flights on weekdays→encode as [0,1,0] (indicating “weekday early flight” mode).
[0326] G232, convert UTC time to airport local time, and introduce winter / summer season transition date features.
[0327] According to the airport IATA code (such as PEK corresponding to UTC+8), convert UTC time to local time. For example, UTC time 2024-10-01T00:30:00Z is converted to city 1 local time 2024-10-01T08:30:00+08:00.
[0328] Winter-spring season: the last Sunday of October to the last Saturday of March; Summer-autumn season: the last Sunday of March to the last Saturday of October; generate binary feature [1, 0] (winter-spring) or [0, 1] (summer-autumn), and calculate the remaining days to the season transition (e.g. 30 days left to the transition from winter-spring to summer-autumn → encoded as 0.3).
[0329] Passenger decisions are usually based on local time (e.g. "city 1 departs at 8 am" instead of UTC time), and time zone conversion makes time features more consistent with user cognition, improving recommendation accuracy; avoiding misjudgment of time features due to time zone differences (e.g. misjudging city 4 08:00 as city 1 08:00).
[0330] Season transition affects flight schedule adjustments (e.g. winter-spring season CAXXXX departure time from 08:30 to 09:00), and season features can automatically adapt to schedule changes; the number of days to the transition feature can predict user sensitivity to "season-end special fares".
[0331] G233, the five-dimensional features are concatenated and mapped to a 64-dimensional space through a trainable matrix, resulting in GX3.
[0332] The five-dimensional features are concatenated in order to form a long vector, for example:
[0333] [absolute timestamp (8 bytes) + logarithmic interval (4 bytes) + periodic feature (14 bytes) + time window (4 bytes) + historical pattern (3 bytes)] → 33 bytes; the concatenated vector is mapped to a 64-dimensional space through a parameter matrix W ∈ R^(33×64), the formula is: GX3 = ReLU(W × concatenated vector + b); where ReLU is the activation function, b is the bias term, and the matrix parameters are optimized through civil aviation historical data.
[0334] From 33-dimensional original features to 64-dimensional (slightly increased dimension), important feature combinations are automatically learned through a trainable matrix, for example, the association weight between "early flight marker" and "Monday periodic feature" is increased, highlighting the "Monday early flight" pattern; after dimension reduction, the calculation amount is reduced, while retaining more than 90% of the time feature information, adapting to real-time recommendation scenarios in civil aviation.
[0335] The trainable matrix dynamically adjusts the weight according to civil aviation data, for example, during the Spring Festival travel period, the association weight between "absolute timestamp" and "historical pattern" is automatically increased to capture the time rules of returning home during the Spring Festival; the 64-dimensional unified dimension facilitates direct fusion with text (GX1) and structure (GX2) features, improving the efficiency of tensor operations.
[0336] G240, GX1, GX2 and GX3 are fused to obtain GZ; where GX3 is used to dynamically adjust the weight of GX1 and GX2 fusion.
[0337] Furthermore, step G240 includes the following steps:
[0338] G241, Get the gate value z t =σ(W z •[GX1;GX2;GX3]); where σ() is the Sigmoid activation function, with an output value range of [0,1]; W z t represents the first trainable weight matrix; t represents time.
[0339] In this embodiment, z t ∈[0,1] represents the degree of openness of the "update gate", W z Training and optimization based on historical civil aviation data.
[0340] When the time feature GX3 displays "User has recently frequently searched for international flights", z t Automatically increase the weights of textual features GX1 (such as the keyword "New York flight") and structural features GX2 (such as the association between "users and international flights"); during off-peak periods (such as late at night), z t Automatically lowering the noise level reduces interference from noise information in the fusion process, allowing the model to focus more on core features (such as historical booking records).
[0341] Abnormal scenario adaptation: When GX3 detects that the "flight season transition date is approaching", z t It will dynamically balance the weights of each modality, for example, by increasing the proportion of "route adjustment" information in the structural feature GX2, thereby improving the ability to predict changes in flight schedules.
[0342] G242, according to z t We get GZ = (1-z) t )⊙h prev +z t ⊙tanh(W) h •[GX1;GX2;GX3]), where W h h is the second trainable weight matrix. prev This represents the fusion feature from the previous time step; ⊙ indicates element-wise multiplication.
[0343] In this embodiment, ⊙ represents element-wise multiplication, and h prev Initialize it as a zero vector, and update it in subsequent iterations.
[0344] In continuous prediction scenarios (such as users querying flights multiple times), h prev Preserve historical fusion features, for example, when a user first queries "City 1-City 2", h prev Record this information; when querying "City 2 - City 3" later, the model will use h prevThe accuracy of recommending connecting flights is greatly improved by perceiving the user's trip continuity.
[0345] When the user temporarily changes the search intention (e.g., from "business class" to "economy class"), the time modality feature GX3 drives z t Quick changes, making the fusion feature GZ quickly adapt to new needs and reduce response delay.
[0346] During the Spring Festival travel period, the weights of historical booking records (structural feature GX2) and current search popularity (text feature GX1) are dynamically adjusted over time: initial stage (30 days in advance): z t Focus on GX2 (historical Spring Festival travel mode); near departure (3 days in advance): z t Focus on GX1 (real-time search keywords).
[0347] G300, adds the specified task corresponding to GZ to GZ as a virtual node to generate the target knowledge graph GZ' corresponding to GZ.
[0348] Add the predicted specified task as a virtual node to GZ to generate the target knowledge graph GZ' containing historical tasks and predicted tasks.
[0349] The virtual node supplements future task information, upgrading the knowledge graph from "pure historical data" to a hybrid structure of "history + prediction"; enhances the completeness of the graph, providing more comprehensive feature input for subsequent prediction (combining historical patterns and predicted trends); connects historical and future tasks through virtual nodes, facilitating the capture of temporal dependency between tasks.
[0350] G400, input the feature vector corresponding to GZ' into the preset target task prediction model to obtain the prediction result corresponding to the target task.
[0351] In this embodiment, the feature vector corresponding to GZ' can be obtained by the method in Embodiment Three; combining historical task features (GZ) and predicted task features (virtual nodes) improves the accuracy and robustness of the prediction model; using the structured information of the knowledge graph, the semantic association and time sequence pattern between entities are captured; the target task model is optimized for specific prediction scenarios to ensure that the results meet the actual needs of users.
[0352] G500, recommend the prediction result corresponding to the target task to the user corresponding to the target user ID.
[0353] The method in the embodiment effectively solves the problem of inaccurate prediction results caused by the lack of future travel nodes in the user knowledge graph in the prior art. By obtaining the target task initial knowledge graph corresponding to the target user ID, when it is found that the entity start time in the graph is all before the current time, a specified task associated with the target task and starting after the current time is predicted using a specified task prediction model, and is added to the initial knowledge graph as a virtual node, thereby constructing a target knowledge graph containing future task information. This way makes up for the defect of missing future travel information in the original knowledge graph, and provides a more comprehensive and accurate data basis for subsequent prediction; inputting the supplemented target knowledge graph feature vector into the preset target task prediction model can more accurately capture the user's potential demand, greatly improving the accuracy of the target task prediction result.
[0354] Embodiment five:
[0355] The method in the above embodiment one to embodiment four will frequently use the knowledge graph corresponding to the target user ID. In order to improve the generation efficiency of the knowledge graph, the following method is provided:
[0356] R100, obtaining a target task corresponding to a target user ID and a preset historical knowledge graph library; wherein the historical knowledge graph library is cached in a preset cache area, and the historical knowledge graph library includes a plurality of historical knowledge graphs, each historical knowledge graph corresponding to a historical task and a historical user ID.
[0357] In the embodiment, the knowledge graph of the user generated by the method in the above embodiment one to embodiment four can be added to the historical knowledge graph library, and the historical knowledge graph library is cached in the preset cache area.
[0358] The historical knowledge graph library is cached in the preset cache area, avoiding reading from the underlying database every time, reducing IO operations, and significantly improving data acquisition speed; in addition, storing multiple user and multiple task historical graphs provides rich reference data for subsequent graph generation based on user behavior and task characteristics.
[0359] R200, obtaining a knowledge graph corresponding to each historical user ID same as the target user ID in the historical knowledge graph library to obtain a historical knowledge graph set RA= (RA1, RA2, …, RA c , …, RA d ), c=1, 2, …, d; RA c is the cth historical knowledge graph corresponding to the target user ID, and d is the number of historical knowledge graphs corresponding to the target user ID.
[0360] In the historical knowledge graph database, by matching user IDs, all historical knowledge graphs that are the same as the target user ID are filtered out, forming the historical graph set RA of the target user.
[0361] This step preserves only the target user's historical graph, eliminating interference from other users and making subsequent analysis more aligned with the user's behavioral patterns and knowledge needs. Based on the same user's historical task graph, their long-term knowledge preferences and task processing habits can be explored, providing a personalized foundation for generating the current task graph.
[0362] R300, obtains the maximum similarity RX between the target task and the historical task corresponding to each historical knowledge graph in RA. max .
[0363] Furthermore, step R300 may include the following steps:
[0364] R310, Obtain the target task and RA c The task type similarity RX of the corresponding historical tasks c,1 Parameter similarity RX c,2 Time similarity RX c,3 .
[0365] In this embodiment, the task type similarity RX c,1 It can measure the similarity between target tasks and historical tasks in terms of business type; parameter similarity RX c,2 It can compare the similarity of task input parameters, reflecting the degree of matching in specific execution details; temporal similarity RX c,3 It can assess the similarity of task execution times and capture the temporal patterns of user behavior. Multi-dimensional evaluation avoids the one-sidedness of a single indicator, comprehensively measures the similarity between tasks, and improves the accuracy of initial graph selection.
[0366] Furthermore, RX c,1 It is obtained through the following steps:
[0367] R311, obtain the tree structure corresponding to several preset tasks; wherein, the tree structure includes a root node, child nodes and task nodes; each root node is connected to several child nodes through edges, and each child node is connected to several task nodes through edges; the root node corresponds to the task scenario, the child nodes correspond to the task type, and the task nodes correspond to the specific task.
[0368] In this embodiment, the root node can be civil aviation business, the child nodes can be trip-related, and the specific task can be trip prediction.
[0369] R312, based on the tree structure, determine the node corresponding to the target task and RA. c Shortest path (RL) between nodes of the corresponding historical tasks c.
[0370] In this embodiment, the shortest path is from the target node to RA. c The path with the fewest edges to the corresponding historical task node, for example: the node corresponding to the target task and the RA. c If the nodes of the corresponding historical tasks belong to the same child node, then RL c =2; For example: Trip Prediction → Trip Related → Civil Aviation Business → Number of Edges = 2; Ticket Recommendation → Ticket Related → Civil Aviation Business → Number of Edges = 2; RL c =2+2=4.
[0371] R313, according to RL c Determine RX c,1 =1 / (1+RL c ).
[0372] The node corresponding to the target task and RA c Shortest path (RL) between nodes of the corresponding historical tasks c The larger the value, the smaller the similarity of the corresponding task types.
[0373] Furthermore, RX c,2 It is obtained through the following steps:
[0374] R314, which sets several preset parameters corresponding to the target task and RA c Several parameters of the corresponding historical tasks are vectorized to obtain the parameter vectors RV1 and RA corresponding to the target task. c The corresponding parameter vector RV2 for the historical task; where RV1 and RV2 have the same dimension.
[0375] In this embodiment, for parameters with specific numerical values, the parameters can be normalized, and for categorical parameters, one-hot encoding can be used to obtain RV1 and RV2.
[0376] R315 defines the cosine similarity between RV1 and RV2 as RX. c,2 .
[0377] It should be noted that those skilled in the art can use existing normalization, one-hot encoding, and cosine similarity calculation methods to obtain RX according to actual needs. c,2 This will not be elaborated upon here.
[0378] Furthermore, RX c,3 It is obtained through the following steps:
[0379] R316, Obtain the predicted execution time RT of the target task. new and RA c The execution time (RT) of the corresponding historical task old.
[0380] In this embodiment, RT new The knowledge graph corresponding to the target user ID can be input into a preset prediction model to obtain.
[0381] R317, according to RT now and RT old , determine RX c,3 =exp(-ε×RT new -RT old ); wherein ε is a preset attenuation factor.
[0382] In this embodiment, the difference between the predicted time and the historical time is calculated, and the smaller the difference, the closer the time. The time difference is converted into similarity by an exponential function exp(): when the time difference is 0, RX c,3 =1 (completely similar); the greater the time difference, the faster the exponential function value decays, and the lower the similarity.
[0383] Attenuation factor ε: used to adjust the influence degree of time difference on similarity, the greater ε, the more sensitive the influence of time difference. For example, in civil aviation, if ε=0.1, a time difference of 10 minutes will reduce the similarity by about 63%; if ε=0.2, the same time difference will reduce the similarity by about 86%, emphasizing the strictness of time matching.
[0384] R320, according to RX c,1 , RX c,2 and RX c,3 , determine the similarity RX c between the target task and the historical task corresponding to RA c =μ1×RX c,1 +μ2×RX c,2 +μ3×RX c,3 , to obtain the task similarity list RX=(RX1,RX2,…,RX c , …, RX d ) corresponding to RA; wherein μ1, μ2 and μ3 are respectively a preset task type similarity weight, a parameter similarity weight and a time similarity weight.
[0385] In this embodiment, μ1, μ2 and μ3 can be adjusted according to the business scenario, such as increasing μ2 for parameter-sensitive tasks; the flexible weight mechanism can adapt to different business scenarios.
[0386] R330, according to RX, determine RX max =MAX(RX); wherein MAX() is a preset maximum function.
[0387] R400, if RX max >RY, then RXmax The corresponding historical knowledge graph is determined as the initial knowledge graph of the target task corresponding to the target user ID; RY is a preset task similarity threshold.
[0388] In this embodiment, if RX max > RY, it means that RX max The corresponding historical task is very similar to the target task corresponding to the target user ID, RX max The corresponding historical knowledge graph contains most of the historical task information required by the target task, so RX max The corresponding historical knowledge graph is determined as the initial knowledge graph of the target task corresponding to the target user ID; RY is a preset task similarity threshold, used to judge whether the matching degree of the historical task and the target task is "high enough"; RY can be obtained based on a large amount of historical data analysis, or specifically set based on different task scenarios.
[0389] R500, according to the initial knowledge graph and the task information of the target user ID in the target time period, generating the target knowledge graph corresponding to the target user ID; the start time of the target time period is the latest time corresponding to the initial knowledge graph, and the end time is the current time.
[0390] Further, step R500 includes the following steps:
[0391] R510, according to the task information of the target user ID in the target time period, obtaining a plurality of entities corresponding to the target user ID and a plurality of attributes corresponding to each entity.
[0392] In this embodiment, the initial knowledge graph contains a plurality of entities, each entity has an execution time, and the latest time can be obtained by comparing all execution times; it can be understood that the target user will generate new task information in the time period from the latest time to the current time, for example, the target user takes a plane in the target time period, generating travel task information; the task information of the target user ID in the target time period can be obtained, and a plurality of entities corresponding to the target user ID and a plurality of attributes corresponding to each entity are obtained.
[0393] R520, adding the plurality of entities corresponding to the target user ID and the plurality of attributes corresponding to each entity to the initial knowledge graph to obtain the target knowledge graph corresponding to the target user ID.
[0394] In this embodiment, for any entity to be added, if there is a node corresponding to an entity of the same type in the initial knowledge graph, for example, a node corresponding to a ticket entity; the entity to be added is converted into a node and connected to the node through an undirected and weightless edge, otherwise, a new node is established; thereby obtaining the target knowledge graph corresponding to the target user ID.
[0395] In this embodiment, in the process of generating the target knowledge graph corresponding to the target user ID, most of the data corresponding to the target knowledge graph is directly used from the historical knowledge graph, only a small amount of entity information is added, and therefore, the method greatly improves the generation efficiency of the knowledge graph.
[0396] R600, according to the target task and the execution frequency, execution time and execution quality of each historical task of the same type as the target task type, adjusting the cache survival time length of the knowledge graph in the historical knowledge graph library corresponding to the historical task of the same type as the target task type.
[0397] Further, step R600 includes the following steps:
[0398] R610, obtaining the latest execution time RT last .
[0399] R620, according to RT last and the current time RT now , get the normalized execution time interval RT norm =-2×(RT now -RT last ) / YT max +1; wherein YT max is a preset maximum time interval.
[0400] Convert the time interval into a standardized value, which is convenient for unified calculation with other indicators (quality, frequency). For example, RT now -RT last =1 day, YTmax=30 days, then RT norm =0.93, indicating that the time interval is very small and the data is highly time-sensitive.
[0401] R630, obtaining the average execution quality RU of the historical task corresponding to the target task type; 0≤RU≤1.
[0402] In this embodiment, the historical task of the same type as the target task type has several parameters when executed, for example: the travel prediction task has parameters such as predicted time consumption, predicted accuracy, etc.; then the several parameters are normalized and weighted to obtain the execution quality.
[0403] R640, normalizing RU to obtain the normalized execution quality RQ norm =2×RU-1.
[0404] Convert the quality index into a value of the same scale as the time interval and execution frequency, which is convenient for subsequent weighted calculation.
[0405] R650, obtaining an execution frequency RF corresponding to the historical task of the same target task type.
[0406] The execution frequency is the number of executions of the same task in a unit of time (such as 1 month); it reflects the high-frequency degree of the task, and a high-frequency task usually requires a more efficient caching strategy.
[0407] R660, normalizing RF to obtain a normalized execution frequency QF norm = 2 x RF / RF max -1; wherein, RF max is a preset maximum execution frequency.
[0408] In this embodiment, RF max can be obtained by analyzing a large amount of historical data.
[0409] R670, according to RT norm , RQ norm and QF norm , adjusting the current cache survival time TTL old of the knowledge graph corresponding to the historical task of the same target task type in the historical knowledge graph library to the target cache time TTL new =TTL old x exp (τ1 x RT norm + τ2 x RQ norm + τ3 x QF norm ); wherein, τ1 is a preset execution time interval weight, τ2 is a preset execution quality weight, and τ3 is a preset execution frequency weight; τ1 + τ2 + τ3 = 1.
[0410] In this embodiment, the cache time is adjusted by weighting, τ1 x RT norm + τ2 x RQ norm + τ3 x QF norm is positive to increase TTL new , and τ1 x RT norm + τ2 x RQ norm + τ3 x QF norm is negative to decrease TTL new .
[0411] For example: a historical task has a high execution frequency (QF norm = 0.8), a high execution quality (RQ norm = 0.6), and is recently executed (RT norm = 0.9); if τ1 = 0.3, τ2 = 0.3, and τ3 = 0.4, then the weighted sum is 0.69, and TTL new = 1.69 x TTL oldThat is, the cache duration is extended by 69%, because high frequency, high quality, and new data are more worthy of caching.
[0412] For example, a certain historical task has low execution frequency (QF norm = 0.2), low execution quality (RQ norm = 0.3), and a long time since the last execution (RT norm = -0.9); if τ1= 0.3, τ2= 0.3, and τ3= 0.4, then the weighted sum is -0.1, and TTL new = 0.9 x TTL old , that is, the cache duration is shortened by 10%, because low frequency, low quality, and old data are not worthy of caching.
[0413] In this embodiment, the cache duration is automatically adjusted according to the time correlation, execution quality, and frequency of the task, avoiding resource waste caused by the "one-size-fits-all" strategy; after the initial graph is determined in step R400, the graph content is updated in step R500, and the storage and retrieval efficiency of the graph is optimized by the cache strategy in step R600, forming a closed loop of "matching-updating-caching". By using the RT norm parameter, the task graph that is executed recently obtains a longer cache, ensuring that the system uses the latest business data preferentially.
[0414] In this embodiment, by constructing a historical knowledge graph cache mechanism based on the user ID, the fast matching and reuse of similar tasks of the same user are realized, and the repeated generation cost of the knowledge graph is significantly reduced; by using the task similarity evaluation mechanism, the historical graph that can be reused is accurately identified, and the efficiency and continuity of the knowledge graph generation are improved; the cache duration is dynamically adjusted based on the task execution characteristics, the cache resource allocation is optimized, the knowledge graph corresponding to high-frequency and high-quality tasks is kept in effective cache, and low-frequency and old data are timely eliminated, so that the response speed and data timeliness of the knowledge graph generation are improved as a whole, and more efficient knowledge support is provided for user business recommendation and prediction.
[0415] In addition, although the steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.
[0416] Embodiments of the present application also provide a non-transitory computer readable storage medium, which can be arranged in an electronic device to save at least one instruction or at least one program related to a method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.
[0417] The program product can employ any combination of one or more computer-readable media. The computer-readable media can be a computer-readable storage medium or a computer-readable signal medium. The computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0418] The computer-readable signal medium can include a computer-readable storage medium that is propagated as a carrier wave. The computer-readable signal medium can be any computer-readable medium that is not a computer-readable storage medium and that can communicate, propagate or transport programming for use by or in connection with an instruction execution system, apparatus, or device.
[0419] The program code embodied on the computer-readable media can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0420] Program code used by or in connection with the described embodiments can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The application is not limited to a particular programming language.
[0421] An embodiment of the present application also provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.
[0422] The electronic device is merely an example, and should not bring any limitation to the functions and usage range of the embodiments of the present application.
[0423] The electronic device is in the form of a general computing device. Components of the electronic device can include, but are not limited to, the at least one processor described above, the at least one memory described above, a bus that connects different system components, including the memory and the processor.
[0424] The memory stores program codes which can be executed by the processor, so that the processor performs steps in various embodiments described in the specification.
[0425] The memory can include a readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory, and can further include a read-only memory (ROM).
[0426] The memory can also include program / utility programs with a set of (at least one) program modules, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof can include implementation of a network environment.
[0427] The bus can be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures.
[0428] The electronic device can also communicate with one or more external devices (such as a keyboard, a pointing device, a Bluetooth device, etc.) and can also communicate with one or more devices that enable a user to interact with the electronic device (and / or one or more input / output (I / O) devices 620) and / or with one or more devices that enable the electronic device to communicate with one or more other computing devices. Such communication can occur via an I / O interface. Still yet, the electronic device can communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or the public network, such as the Internet) through a network adapter. It should be appreciated that the network adapter can be communicatively coupled to the other modules of the electronic device via a bus. It should be appreciated that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0429] Those skilled in the art can clearly understand the example embodiments described herein through the above description of the example embodiments, and the example embodiments described herein can be implemented by software or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0430] Embodiments of the present disclosure also provide a computer program product comprising program code for causing an electronic device to perform the steps of the methods according to the various example embodiments of the present disclosure described above in the specification when the program product is run on the electronic device.
[0431] Although some specific embodiments of the present disclosure have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration, and are not intended to limit the scope of the present disclosure. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present disclosure.
Claims
1. A knowledge graph-based method for predicting the destination of categorized users in the civil aviation field, characterized in that, The method includes the following steps: H100: Obtain information on each historical travel task corresponding to the target user ID; each historical travel task information includes at least the start time of the corresponding travel task. H200 treats each historical travel task as a node and connects each node sequentially according to the order of the travel task execution time to obtain the travel task knowledge graph HA corresponding to the target user ID; each node of HA includes the start time, end time, origin and destination of the corresponding travel task. H300, extract the feature vector of HA to obtain the historical travel task feature vector HX corresponding to HA; H400 inputs HX into a preset user type classification model to determine whether the user corresponding to the target user ID is a long-term user or a short-term user; where long-term users are users whose travel behavior forms a periodic pattern, and short-term users are users whose travel behavior does not form a periodic pattern. H500: If the user corresponding to the target user ID is a long-term user, then the time period corresponding to the earliest start time and the latest start time in the historical travel tasks corresponding to the target user ID shall be determined as the target time period. H600, if the user corresponding to the target user ID is a short-term user, then the target time period corresponding to the target user ID is determined according to HA; Step H600 includes the following steps: H610, calculate the temporal distribution density of nodes in HA, and generate the probability density function f(t) on the time axis by estimating the kernel density; t is time; H620 identifies peak regions in f(t) and defines continuous time periods with density values higher than a preset density threshold as target density time clusters. H630, if the number of target density time clusters is greater than 1, then select the time cluster containing the most recent HN travel tasks as the candidate target time period; H640, the candidate target time period is extended by the boundary, including: extending forward by τ1 time units to include potential preparation phases, and extending backward by τ2 time units to cover possible journey continuation; H650: If the extended time period includes the current time, then the extended time period is determined as the target time period; otherwise, the future time period closest to the current time is selected as the target time period. H700: Obtain several different types of historical task information corresponding to the target user ID within the target time period, in order to generate a knowledge graph HZ corresponding to the target user ID; H800 predicts the destination corresponding to the target user ID based on HZ.
2. The knowledge graph-based method for predicting user destinations in the civil aviation field according to claim 1, characterized in that, Step H300 includes the following steps: H310, based on HA, determine the structural complexity HD1 and the regularity of the target user's travel HD2 corresponding to HA; HD1 is obtained based on the number of nodes corresponding to each node type in HA, and HD2 is obtained based on the start time corresponding to each node in HA. H320, if HD1≥HD1' and HD2<HD2', then the first feature extraction method is used to extract the feature vector of HA to obtain HX; where HD1' is a preset structural complexity threshold and HD2' is a preset regularity threshold; H330, if HD1 < HD1' and HD2 ≥ HD2', then use the second feature extraction method to extract the feature vector of HA to obtain HX; H340, if HD1≥HD1' and HD2≥HD2', then use the first feature extraction method and the second feature extraction method to extract the feature vector of HA to obtain HX.
3. The knowledge graph-based method for predicting the destination of categorized users in the civil aviation field according to claim 2, characterized in that, The step of extracting feature vectors from HA using the first feature extraction method includes the following steps: H321 transforms HA into a heterogeneous graph structure to obtain the heterogeneous travel task knowledge graph HB corresponding to HA; where the node types of HB include departure point, destination and start time, and the edge types include time sequence relationship and the association relationship between departure point and destination. H322 uses a graph attention neural network to encode HB and learns the importance weights of different types of nodes and edges through a multi-head attention mechanism to generate node embedding vectors; H323 concatenates all node embedding vectors in chronological order and calculates the context weight of each node through a self-attention mechanism to obtain the historical travel task feature vector HX.
4. The knowledge graph-based method for predicting the destination of categorized users in the civil aviation field according to claim 2, characterized in that, The step of using the second feature extraction method to extract feature vectors from HA includes the following steps: H331 periodically encodes the time information of each node in HA to generate a time feature vector; H332 performs geographic semantic encoding on the origin and destination in HA, and extracts semantic features of location type and latitude-longitude relationship; H333 performs tensor fusion of temporal feature vectors, semantic feature vectors, and node structural feature vectors, and maps them to historical travel task feature vectors HX through a multilayer perceptron.
5. The knowledge graph-based method for predicting user destinations in the civil aviation field according to claim 2, characterized in that, Step H340 includes the following steps: H341, use the first feature extraction method to extract the feature vector of HA to obtain the first intermediate feature vector HX1; H342, use the second feature extraction method to extract the feature vector of HA to obtain the second intermediate feature vector HX2; H343, fuse HX1 and HX2 to obtain HX=δ1×HX1+δ2×HX2; where δ1 and δ2 are the weights corresponding to the first feature extraction method and the second feature extraction method, respectively; δ1+δ2=1.
6. The knowledge graph-based method for predicting the destination of categorized users in the civil aviation field according to claim 2, characterized in that, HD1 is obtained through the following steps: H311, retrieve the number of nodes corresponding to each type of node in HA, to obtain the node count list NA = (NA1, NA2, ..., NA311). a , ..., NA b ), a=1,2,…,b;NA a Let b be the number of nodes corresponding to the a-th type of node in HA, and b be the number of node types corresponding to HA. H312, based on NA, determine the proportion corresponding to each type of node to obtain the node proportion list HP = (HP1, HP2, ..., HP...). a HP b ); HP a for NA a Corresponding node ratio; HP a =NA a / ∑ b a=1 NA a ; H313, based on NA, determine HD1 = -∑ b a=1 HP a ×log2HP a .
7. The knowledge graph-based method for predicting the destination of categorized users in the civil aviation field according to claim 2, characterized in that, HD2 is obtained through the following steps: H314, retrieves the start time for each node in HA; H315, retrieves the time interval between two adjacent start times; H316 discretizes the time interval to obtain the frequency distribution; H317, based on the frequency distribution, yields HD2.
Citation Information
Patent Citations
Civil aviation passenger source data analysis method, electronic equipment and computer readable storage medium
CN112231392A
Multi-feature fusion travel purpose estimation method and system based on LBS / AOI / POI data
CN116629637A