Method and device for caching flight data

By analyzing flight history data to predict the number of user queries and optimizing the flight data cache refresh strategy, it solves the problem of limited flight data cache resources and improves query response speed and user experience.

CN118152439BActive Publication Date: 2024-09-13CHINA EASTERN AIRLINES CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410330262.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2024-09-13
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

Due to limited resources, the airline's back-end server is difficult to cache all flight data, causing users to face problems such as untimely data refresh and slow loading when querying.

Method used

By analyzing flight history data, it predicts the number of times users query flight data under specified conditions, determines the refresh times of cached flight data, refreshes cached data in a timely manner, and improves the cache hit rate.

Benefits of technology

It improves the response speed and timeliness of users querying flight data, reduces the pressure on the backend server, and improves user experience and satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118152439B
    Figure CN118152439B
Patent Text Reader

Abstract

The present disclosure relates to a method and apparatus for caching flight data. The method for caching flight data includes: obtaining historical query data for flight data, wherein each historical query data includes an entity group of query information and query time; dividing the historical query data with the same query information and query time into a first set; counting the number of historical query data included in the first set as the number of historical queries of the first entity group corresponding to the first set; generating a first sample set for multiple first sets of first information based on the query information; training a first prediction model using the first sample set so that the first prediction model can output a first predicted query number for the first information when a specified query time is input; and determining a first refresh number of the flight data corresponding to the first information in the cached flight data at the specified query time according to the first predicted query number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to data processing in the aviation field, and more specifically, to a method and device for caching flight data. Background Art

[0002] Airlines have a huge number of flights every day, and users' demand for air travel is growing. Correspondingly, the number of queries for flight data on the website is also growing. Due to the large number of queries for flight data and limited server resources, the backend server is under great pressure. Generally, flight data needs to be cached in advance for query, but there is a lot of flight data and the data validity time is short, so it is impossible to cache all flight data. Therefore, when users query flight data, they often face the problem of untimely data refresh and slow loading. Summary of the invention

[0003] A brief overview of the disclosure is given below in order to provide a basic understanding of some aspects of the disclosure. However, it should be understood that this overview is not an exhaustive overview of the disclosure. It is not intended to identify the key or important parts of the disclosure, nor is it intended to limit the scope of the disclosure. Its purpose is simply to give some concepts of the disclosure in a simplified form as a prelude to a more detailed description given later.

[0004] According to a first aspect of the present disclosure, a method for caching flight data is provided, the method comprising:

[0005] Obtain historical query data for flight data, where each historical query data includes an entity group of query information and query time;

[0006] The historical query data with the same query information and query time are divided into a first set, wherein the query information includes the first route information from the departure airport to the arrival airport and the first number of days before the departure date;

[0007] Counting the number of historical query data included in the first set as the number of historical queries of the first entity group corresponding to the first set;

[0008] generating a first sample set for a plurality of first sets of first information based on the query information, wherein the first sample set includes sample data indicating a relationship between a query time and a historical query count of the first entity group;

[0009] Using the first sample set to train the first prediction model, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input; and

[0010] According to the first predicted query number, a first refresh number of the flight data corresponding to the first information in the cached flight data at the specified query time is determined.

[0011] In some embodiments, determining a first refresh number of flight data corresponding to the first information at a specified query time includes:

[0012] For the specified query time, perform the following operations respectively:

[0013] The first total refresh times are set, and the first predicted query times for each query information are counted to obtain the first predicted query total times, where:

[0014] When the first predicted query total number is greater than the first refresh total number, calculating a first ratio of the first predicted query total number to the first refresh total number, and multiplying the first predicted query number by the first ratio to generate a first refresh number; and

[0015] When the total number of first prediction queries is not greater than the total number of first refreshes, the first prediction query number is used as the first refresh number.

[0016] In some embodiments, the method further comprises:

[0017] Obtain historical ticket booking data for flight data, wherein each historical ticket booking data includes an entity group of ticket booking information and ticket booking time;

[0018] The historical ticket booking data with the same ticket booking information and ticket booking time are divided into a second set, wherein the ticket booking information includes the second route information from the departure airport to the arrival airport and the second number of days in advance to the departure date;

[0019] Counting the number of historical ticket booking data included in the second set as the number of historical queries of the second entity group corresponding to the second set;

[0020] generating a second sample set for a plurality of second sets of second information based on the ticket booking information, wherein the second sample set includes sample data indicating a relationship between a ticket booking time and a historical query count of the second entity group;

[0021] Using the second sample set to train the second prediction model, so that the second prediction model can output a second predicted query number for the second information when a specified query time is input;

[0022] Determining a second refresh number of the flight data corresponding to the second information in the cached flight data at the specified query time according to the second predicted query number; and

[0023] The first refresh number and the second refresh number are integrated to generate a target refresh number of each flight data in the cached flight data at a specified query time.

[0024] In some embodiments, generating a target refresh number of each flight data in the cached flight data at a specified query time includes:

[0025] When the first information is the same as the second information, only the flight data corresponding to the first information is retained in the cached flight data, and the larger of the first refresh number and the second refresh number is used as the target refresh number of the flight data corresponding to the first information;

[0026] When the first information is different from the second information, both the flight data corresponding to the first information and the flight data corresponding to the second information are retained in the cached flight data, and the first refresh number and the second refresh number are used as the target refresh number of the flight data corresponding to the first information and the target refresh number of the flight data corresponding to the second information respectively.

[0027] In some embodiments, determining a second refresh number of flight data corresponding to the second information in the cached flight data at a specified query time includes:

[0028] For the specified query time, perform the following operations respectively:

[0029] The second total refresh times are set, and the second prediction query times for each ticket booking information are counted to obtain the second total prediction query times, where:

[0030] When the second predicted query total number is greater than the second refresh total number, calculating a second ratio of the second predicted ticket booking total number to the second refresh total number, and multiplying the second predicted query number by the second ratio to generate a second refresh number;

[0031] When the second prediction query total number is not greater than the second refresh total number, the second prediction query number is used as the second refresh number.

[0032] In some embodiments, the method further comprises:

[0033] The target refresh number is adjusted based on the category of each flight data in the cached flight data to generate an optimized refresh number of the flight data.

[0034] In some embodiments, generating an optimized refresh number of flight data includes:

[0035] Classifying the flight data in the cached flight data that conform to the preset category into a third set, wherein the preset category includes third route information from the departure airport to the arrival airport and the itinerary type of the flight;

[0036] The flight data in the third set are arranged in descending order according to the target refresh times, and for the flight data in the third set, let the counter i=1, and perform the following operations cyclically:

[0037] Determine whether the target refresh number of the i-th flight data is greater than the preset maximum refresh number;

[0038] In response to the target refresh number of the i-th flight data being less than or equal to the preset maximum refresh number, exiting the loop;

[0039] In response to the target refresh number of the i-th flight data being greater than the preset maximum refresh number, setting the target refresh number of the i-th flight data to the preset maximum refresh number, and calculating the i-th refresh number difference between the target refresh number of the i-th flight data and the preset maximum refresh number;

[0040] Based on the i-th refresh number difference and the preset number of flights n, n flight data that meet the preset category and have different numbers of days before the flight departure date are created, and a specified refresh number that is less than the preset maximum refresh number is assigned to the n flight data, wherein the sum of the specified refresh numbers of the n flight data is less than or equal to the i-th refresh number difference;

[0041] When i is equal to the total number of flight data in the third set, the loop is exited; and

[0042] Increment counter i by 1.

[0043] In some embodiments, the method further comprises:

[0044] A refresh sequence table of cached flight data is generated, and each flight data in the cached flight data is refreshed based on the refresh sequence table.

[0045] In some embodiments, generating a refresh sequence list for cached flight data includes:

[0046] Sort the cached flight data to get the refresh set, where flight data A1, A2, ..., A m According to its target refresh number n1, n2, ..., n m Arranged in descending order, m is the total number of categories of flight data in the refresh set;

[0047] The flight data A1 is used as the initial sequence list with a length of n1;

[0048] When m<2, the initial sequence list is used as the refresh sequence list;

[0049] When m≥2, let the counter j=2 and perform the following operations cyclically:

[0050] Calculate flight data A1 to A j-1 The target refresh number n1 to n j-1 The sum of n sum ;

[0051] n sum / n j Round the flight data A to the interval number j Insert into the current refresh sequence table;

[0052] When j equals the total number of categories m, the loop is exited; and

[0053] Increment counter j by 1.

[0054] According to a second aspect of the present disclosure, a device for caching flight data is provided, the device comprising:

[0055] An acquisition module is configured to acquire historical query data for flight data, wherein each historical query data includes an entity group of query information and query time;

[0056] The processing module is configured as follows:

[0057] The historical query data with the same query information and query time are divided into a first set, wherein the query information includes the first route information from the departure airport to the arrival airport and the first number of days before the departure date;

[0058] Counting the number of historical query data included in the first set as the number of historical queries of the first entity group corresponding to the first set;

[0059] taking multiple first sets of query information as first information as first sample sets, wherein the first sample sets include sample data indicating a relationship between a query time and a historical query count of the first entity group;

[0060] A prediction module configured to train a first prediction model using a first sample set, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input; and

[0061] The refresh module is configured to determine a first refresh number of the flight data corresponding to the first information in the cached flight data at a specified query time according to the first predicted query number.

[0062] According to a third aspect of the present disclosure, a device for caching flight data is provided, the device comprising:

[0063] Processor; and

[0064] A memory storing computer executable instructions which, when executed by the processor, cause the processor to perform the method for caching flight data as described above.

[0065] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which computer-executable instructions are stored. When the computer-executable instructions are executed by one or more processors, the one or more processors execute the method for caching flight data as described above.

[0066] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product comprising computer executable instructions, which when executed by one or more processors enable the one or more processors to execute the method for caching flight data as described above.

[0067] The advantage of the embodiments of the present disclosure is that the association model between flight data and query times is trained by analyzing historical flight data, so as to provide a data basis for the refresh times of cached flight data and optimize the allocation of limited cache resources.

[0068] Another advantage of the embodiments of the present disclosure is that historical query data and historical booking data are integrated, which can more accurately analyze which routes users are more inclined to query during a specified query time period, thereby improving user query response data and increasing route user satisfaction.

[0069] Other features and advantages of the present disclosure will become more apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The foregoing and other features and advantages of the present disclosure will become apparent from the following description of the embodiments of the present disclosure in conjunction with the accompanying drawings. The accompanying drawings are incorporated herein and form a part of the specification, and are further used to explain the principles of the present disclosure and enable those skilled in the art to make and use the present disclosure. Among them:

[0071] Figure 1 A flow chart of a method for caching flight data according to an embodiment of the present disclosure is shown;

[0072] Figure 2 A schematic diagram of a process for determining a first refresh number in a method for caching flight data according to an embodiment of the present disclosure is shown;

[0073] Figure 3 A schematic diagram of a process for processing historical booking data in a method for caching flight data according to another embodiment of the present disclosure is shown;

[0074] Figure 4 A schematic diagram of a process for determining a second refresh number in a method for caching flight data according to another embodiment of the present disclosure is shown;

[0075] Figure 5 A schematic diagram of a process for integrating and adjusting prediction results in a method for caching flight data according to another embodiment of the present disclosure is shown;

[0076] Figure 6 A schematic diagram of a process of integrating flight data and determining a target refresh number after integration in a method for caching flight data according to another embodiment of the present disclosure is shown;

[0077] Figure 7 A schematic diagram of a process for determining the number of optimized refresh times after integration in a method for caching flight data according to another embodiment of the present disclosure is shown;

[0078] Figure 8 A schematic diagram of a process for generating a refresh sequence table in a method for caching flight data according to an embodiment of the present disclosure is shown;

[0079] Fig. 9 A schematic diagram showing a refresh sequence table according to an embodiment of the present disclosure is shown;

[0080] Fig.10 A schematic block diagram of a device for caching flight data according to an embodiment of the present disclosure is shown;

[0081] Fig.11 A schematic block diagram of a device for caching flight data according to an embodiment of the present disclosure is shown;

[0082] Fig.12 An exemplary configuration of a computing device that can implement an embodiment according to the present disclosure is shown.

[0083] Note that in the embodiments described below, sometimes the same reference numerals are used in common between different drawings to represent the same parts or parts with the same functions, and their repeated descriptions are omitted. In some cases, similar numbers and letters are used to represent similar items, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0084] For ease of understanding, the position, size, range, etc. of each structure shown in the drawings and the like may not represent the actual position, size, range, etc. Therefore, the present disclosure is not limited to the position, size, range, etc. disclosed in the drawings and the like. DETAILED DESCRIPTION

[0085] Various exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure.

[0086] The following description of at least one exemplary embodiment is in fact merely illustrative and is in no way intended to limit the present disclosure and its application or use. That is, the structures and methods herein are shown in an exemplary manner to illustrate different embodiments of the structures and methods in the present disclosure. However, those skilled in the art will appreciate that they merely illustrate exemplary ways of the present disclosure that can be implemented, rather than exhaustive ways. In addition, the drawings need not be drawn to scale, and some features may be enlarged to illustrate the details of specific components.

[0087] In addition, the techniques, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the techniques, methods and devices should be considered as part of the specification. In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0088] In summary, the technical solution disclosed in the present invention mainly relates to a data processing method, device, equipment and storage medium for improving the user query experience by analyzing the query data of historical flight data to set the refresh times of the corresponding flight data in the cache. Generally, the response speed of user query flight data can be improved by caching flight data in advance. However, the back-end servers of airlines currently generally have limited resources, making it difficult to cache all flight data, so only part of the flight data can be cached in advance. In addition, as the user's demand for querying flights increases and the timeliness requirements for flight data increase, some of the flight data cached in advance are difficult to hit the flight data that the user expects to query, resulting in untimely data feedback and affecting the user experience.

[0089] In order to solve the above problems, the present disclosure proposes a method for caching flight data. The method is based on the historical data of aviation users, mines the inherent laws of the historical data of users, predicts the number of times users query flight data under specified conditions, and determines the refresh number of corresponding flight data in the cached flight data, so as to timely and targetedly refresh the cached flight data and improve the cache hit rate. It should be understood that the cache hit rate in this article is used to indicate the effectiveness of the cached flight data compared to the actual query of the flight data by the user, so as to characterize the accuracy of the cache prediction algorithm, such as the ratio of the number of times the cached flight data hits the flight data queried by the user to the total number of user queries.

[0090] The following will be combined Figure 1-Figure 8A method for caching flight data according to various embodiments of the present disclosure is described in detail. It is understandable that the actual method may also include other steps. In order to avoid blurring the main points of the present disclosure, these other steps are not shown in the accompanying drawings; and the division of the various steps in the accompanying drawings is only for example and not for limitation of the embodiments. These steps can be completed individually by each subject shown in the embodiments of the present disclosure, two or more of them are completed together, or by an external system not shown in the figure in cooperation with the illustrated subject, and are not limited to the distribution method shown in the embodiment. They can be completed in sequence according to the illustrated order or in parallel in accordance with the data flow direction and system operation rules, and can be completed in steps or in combination.

[0091] like Figure 1 As shown, Figure 1 A method for caching flight data according to an embodiment of the present disclosure is shown. The method includes steps S110 to S160, which will be described below respectively.

[0092] At step S110, historical query data for flight data is obtained. The user's query data (also called shopping data) is mainly generated based on the user's behavior of querying flight data on the website. Each query operation can generate a query data. Generally, a query data can include an entity group of query information and query time.

[0093] The historical query data may record parameters related to the user's query of flight data and other parameters associated with the query action, including but not limited to. For example, the historical query data may include the following exemplary parameters: departure time (take-off time), departure airport, arrival airport, itinerary type (for example, one-way and round trip), query time, cache hit flag, file storage date, etc., wherein the cache hit flag is mainly used to indicate that the flight data queried by the user falls into the data that has been cached in advance, etc. In particular, when the itinerary type is round trip, the historical query data may specifically include the departure time of the outbound / return trip, the departure airport of the outbound / return trip, the arrival airport of the outbound / return trip, etc.

[0094] In some embodiments, the generated query data may be stored in a database or a big data platform. Since the number of requests for querying flight data is huge every day, it is difficult to record the user's query data in real time. Therefore, the user's historical query data may be recorded in a log file, and the log file may be transmitted to a data center at a regular interval (e.g., via a message queue Kafka) for the data center to parse the historical query data in the log file, and the parsed historical query data may be stored in a database or a big data platform (e.g., an impala big data platform).

[0095] According to the query time in the historical query data, the month, date, hour, minute and day of the week of the query time can be obtained. For example, when the query time is 9:10 am on May 8, 2023 (recorded as 2023-05-08 09:10:00 in the standardized format), the month is 05, the date is 08, the hour is 09, the minute is 10 and the day of the week is 1. The corresponding historical query data can be grouped and analyzed according to the above parameters to provide a basis for further data analysis, and to mine the trend and / or seasonal (periodic) law of user query flight data.

[0096] Additionally or alternatively, the processing operation of step S110 may also include preprocessing the acquired historical query data, such as standardization, defective data exclusion, etc., so as to rewrite the flight data and query time queried by the user into a preset unified format to improve data processing efficiency and accuracy.

[0097] As will be described in detail below, corresponding processing can be performed based on the user's historical query data for flight data that has been stored in the database or big data platform to analyze the user's query preferences, thereby predicting the number of queries for specified query information at a specified query time.

[0098] Next, in step S120, the historical query data with the same query information and query time are divided into the first set. Specifically, the query information may include the first route information from the departure airport (or departure place) to the arrival airport (or arrival place) and the first number of days in advance from the flight departure date. It should be understood that in the various embodiments described below, the route information can be described based on "departure place to arrival place", and when there are multiple airports in the same departure place / arrival place, "departure place" is similarly used to indicate any or all departure airports in the departure place, and "arrival place" indicates any or all arrival airports in the arrival place. In a non-limiting embodiment, for a flight from Beijing to Shanghai with a departure date of May 12, 2023, the user queries the data of the flight on May 8, 2023, then its first route information may be "Beijing to Shanghai", and the first number of days in advance is 4 days. It should also be understood that the same query time described herein may be one or more of the same number of months, days, hours, minutes and days of the week in which the query time is located.

[0099] In a non-limiting embodiment, historical query data may be first grouped according to query information to generate multiple first data groups, and then historical query data with the same query time (e.g., hours) may be divided into a first set for the first data groups to facilitate subsequent organization and generation of sample data, thereby improving processing efficiency.

[0100] Specifically, the historical query data is grouped according to the query information, and the historical query data is clustered based on the user's query operation and the query preference reflected in the query operation, so as to provide a basis for the training samples of the query frequency prediction model, thereby improving the prediction accuracy. Still taking the data of querying Beijing to Shanghai flights 4 days in advance as an example, the historical query data that satisfies the first route information of Beijing to Shanghai and is 4 days away from the first advance date are divided into the same first data group, wherein the distinguishing dimension of each historical query data in the first data group can be the different itinerary types of the flight and the number of months, days of the week and dates included in the query time, or can be the IP address of the user's query action, the terminal type, etc., or can also be the group portrait of the query user, etc. Therefore, the query information can also include at least one of these distinguishing dimensions, so as to obtain a data grouping result with more distinct clustering characteristics, such as analyzing the seasonal / daily distribution law of the user's query for different months, different days of the week or different dates, so as to analyze the user's historical query data in more detail. Furthermore, in order to analyze the trends and patterns of users querying corresponding flight data at different hours, for each first data group in the multiple first data groups, the historical query data with the same hours in the query time can be divided into a first set to generate multiple first sets based on hours.

[0101] Further, the method for caching flight data according to an embodiment of the present disclosure may also include: step S130, counting the number of historical query data included in the first set as the historical query times of the first entity group corresponding to the first set; step S140, generating a first sample set for multiple first sets of first information based on the query information. The first sample set includes sample data indicating the relationship between the query time and the historical query times of the first entity group.

[0102] In a non-limiting embodiment, for the first data group of historical query data with the same query information (for example, the query information may be the first information with the first route information being from Beijing to Shanghai and the first number of days in advance being 4 days), it is divided into one or more first sets based on the number of hours in the query time, and the number of historical query data included in each first set is counted, so as to form the number of historical queries corresponding to each hour when the query information is the first information as shown in the following table:

[0103] Query time Hours Historical query times 2023-05-08 08:00 08 200 2023-05-08 09:00 09 300 2023-05-08 10:00 10 250

[0104] The first set can be used to generate a first sample set for subsequent training of a prediction model, wherein the sample data in the first sample set can indicate the relationship between the query time and the number of historical queries of the corresponding first entity group (e.g., can be represented by a vector [query information, query time]).

[0105] It should be understood that in some other non-limiting embodiments, the historical query data can be divided into multiple first data groups based on the query time, and then each first data group can be divided into multiple first sets based on the query information. The specific steps of the division are not limited here, and it is only necessary to satisfy that the query information in the divided first set is the same as the query time. In other words, the order of the steps for grouping the historical query data can be adjusted according to actual needs, such as performing more rounds of grouping operations according to different distinguishing dimensions, and under the condition of ensuring the grouping results, the convenience of data calculation is not limited to the order of the grouping operations.

[0106] By grouping the historical query data to form multiple first sets, it is convenient to analyze the trend change of the number of historical queries of users over time. In a non-limiting embodiment, for flight data with the same route information, the number of queries of users in the corresponding hours of any two days (i.e., the same day of the week) with a difference of 7 days in advance may meet or approximately meet the preset rules. Additionally or alternatively, due to the influence of the morning and evening peaks, the number of queries of users at different hours of the day may show a trend of first rising and then falling, then rising and then falling.

[0107] Furthermore, the method for caching flight data according to an embodiment of the present disclosure may also include: step S150, training a first prediction model using a first sample set, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input.

[0108] The prediction model trained with the sample data generated in the aforementioned steps can be used to provide a prediction of the number of queries for the corresponding query information for the query time specified by the user. Specifically, the specified query time can be obtained from the user's current query behavior or directly specified by the user, and the specified query time is used as a specified input when applying the prediction model. In some embodiments, the aforementioned prediction model can be established based on a time series prediction algorithm, such as taking the specified query time as input and the predicted number of queries for the corresponding query information as output. The query information can be used as a basis for distinguishing the categories of flight data, and the predicted number of queries for the corresponding query information output indicates the predicted number of queries for the flight data of the corresponding category. For example, it can be predicted that at the specified query time, the query number of flight data with the first route information of "Beijing to Shanghai" and the first number of days in advance of "4 days" can be query-ed.

[0109] In some embodiments, a time series prediction algorithm may be used to determine the predicted query number for the flight data corresponding to the first information based on a specified query time. The historical query number of flight data obtained based on the historical query data conforms to the trend change and seasonal change with the time series, and based on this, the time series prediction algorithm can predict the number of times the flight data may be queried in the future time series (i.e., the query time to be predicted). In a non-limiting embodiment, the time series prediction algorithm may use the Holt-Winters algorithm. It should be understood that in some embodiments, other time series prediction algorithms such as the autoregressive (AR) time series prediction algorithm and the autoregressive integrated moving average (ARIMA) time series prediction algorithm may also be used to determine the predicted query number.

[0110] Specifically, the Holt-Winters time series forecasting algorithm is also called the third-order exponential smoothing algorithm, which can predict time series that contain both trends and seasonality. The following describes this algorithm in combination with the first-order exponential smoothing algorithm and the second-order exponential smoothing algorithm.

[0111] The first-order exponential smoothing algorithm can be based on the recurrence relationship of the following formula:

[0112] S i =αx i +(1-αβ)S i-1 .

[0113] Among them, i is the index of the last data, x i is the data value of the current time series (i.e., the number of queries), S i is the smoothed value of the current data, S i-1 is the smoothed value of the previous i data.

[0114] α is the first smoothing index, which takes values ​​in the range of greater than or equal to 0 and less than or equal to 1. The closer α is to 1, the closer the smoothed value is to the data value of the current time series (i.e., S i The closer to x i ), the less smooth the data is, the closer α is to 0, and the smoothed value is closer to the smoothed value of the previous i data (i.e., S i The closer to x i ).

[0115] The prediction formula of the first-order exponential smoothing algorithm is: i+h =S i , which is a straight line, and cannot reflect the trend and seasonality of the time series. Where h is the index of the data in the future time series.

[0116] The second-order exponential smoothing algorithm retains the trend information, so that the predicted time series value can contain the trend of the previous data. The second-order exponential smoothing adds an additional variable T to represent the trend information of the previous data. The second-order exponential smoothing algorithm can be based on the recursive relationship of the following formula:

[0117] S i =αx i +(1-α)(S i-1 +T i-1 ),

[0118] T i =β(S i -S i-1 )+(1-β)T i-1 .

[0119] Where β is the second smoothing index, which takes values ​​in the interval greater than or equal to 0 and less than or equal to 1. The prediction formula of the second-order exponential smoothing algorithm is x i+h =S i +hT i The prediction result of the second-order exponential smoothing is a slanted straight line, and its prediction result is based on the trend information of previous data.

[0120] The third-order exponential smoothing algorithm retains seasonal information on the basis of the second-order exponential smoothing algorithm, so that it can predict time series with seasonality. When a time series has a certain repetitive pattern in each fixed time interval, it is said to have seasonal characteristics, and such a time interval is called a seasonal cycle. The length k of a seasonal cycle is the number of time series contained in the seasonal cycle. The third-order exponential smoothing adds an additional variable P to represent the seasonal information of the previous data, among which the third-order exponential smoothing algorithm can be based on the recursive relationship of the following formula:

[0121] S i =α(x i -P i-k )+(1-α)(S i-1 +T i-1 ),

[0122] T i =β(S i -S i-1 )+(1-β)T i-1 ,

[0123] P i =γ(x i / S i )+(1-γ)P i-k .

[0124] Among them, γ is the third smoothing index, which takes values ​​in the interval greater than or equal to 0 and less than or equal to 1. The prediction formula of the third-order exponential smoothing is: i+h =(S i +hT i ) i-k+h , whose prediction results are based on the trend information of previous data and the seasonal information of the data.

[0125] According to an embodiment of the present disclosure, the above-mentioned time series prediction algorithm can be trained using a sample data set generated based on the query information as multiple first sets of first information. For example, the optimal first smoothing index α, second smoothing index β and third smoothing index γ in the Holt-Winters time series prediction algorithm can be trained to improve the accuracy of the prediction results.

[0126] In order to refresh cached flight data in time and improve the response speed and timeliness of corresponding flight data when users query, the method for caching flight data according to an embodiment of the present disclosure may also include: step S160, determining the first refresh number of flight data corresponding to the first information in the cached flight data at the specified query time based on the first predicted query number.

[0127] The refresh times are positively correlated with the predicted query times. If a flight data is queried more times based on historical query data, it is predicted that the flight data may be queried more times. Therefore, the flight data needs to be refreshed more times in the cache to ensure that users who query the flight can know its real-time status in a timely manner.

[0128] In some embodiments, the refresh times of the flight data corresponding to the first information in each time period may be determined. In a non-limiting embodiment, the refresh times of each flight data in the time period corresponding to the specified hours may be determined. Alternatively, the time periods in hours may be combined or split according to needs to determine the refresh times of the corresponding flight data in a specific time period.

[0129] Specifically, if Figure 2 As shown, the following steps may be performed respectively: at step S161, setting the first total refresh times; at step S162, counting the first predicted query times for each query information to obtain the first predicted query total times.

[0130] Among them, continue to refer to Figure 2The refresh times of the flight data corresponding to each query information can be determined by the following steps: at step S162a, when the total number of first predicted queries is greater than the total number of first refreshes, calculate the first ratio of the total number of first predicted queries to the total number of first refreshes, and multiply the first predicted query times by the first ratio to generate the first refresh times; at step S162b, when the total number of first predicted queries is not greater than the total number of first refreshes, use the first predicted query times as the first refresh times.

[0131] In addition, in some embodiments, the above steps may be performed for the number of refreshes within a specific time period. For example, the specific time period may be a number of consecutive hours, and the above steps may be performed for the hour 08 and the hour 09 to determine the number of refreshes of the flight data corresponding to each query information within the time period of 08:00-10:00. Alternatively, the specific time period may also be a time unit shorter than an hour, such as the above steps may be performed for minutes to determine the number of refreshes of the flight data corresponding to each query information within a time period with a smaller time interval.

[0132] The historical query data is recorded in the form of log files, and the log files have a large amount of data. In the process of file transmission and log recording, there may be file loss, program abnormality, network transmission abnormality, etc., which may lead to the loss of some historical query data or the lack of some elements in the historical query data, thereby making the calculation results based on the historical query data incomplete or the accuracy rate reduced. To solve this problem, in another embodiment of the present disclosure, the refresh number of cached flight data can also be determined based on the historical booking data to correct and / or supplement the calculation results based on the historical query data.

[0133] For details, please refer to Figure 3 , Figure 3A flow chart of processing historical booking data in a method for caching flight data according to another embodiment of the present disclosure is shown. The processing of historical booking data may include: at step S210, acquiring historical booking data for flight data; at step S220, dividing historical booking data with the same booking information and booking time into a second set; at step S230, counting the number of historical booking data included in the second set as the number of historical queries of the second entity group corresponding to the second set; at step S240, generating a second sample set for multiple second sets of second information based on the booking information, wherein the second sample set includes sample data indicating the relationship between the booking time and the number of historical queries of the second entity group; at step S250, training a second prediction model using the second sample set so that the second prediction model can output a second predicted query number for the second information when a specified query time is input; and at step S260, determining a second refresh number of the flight data corresponding to the second information in the cached flight data at the specified query time according to the second predicted query number.

[0134] Historical booking data is mainly based on the user's booking records. Its generation process and storage location are quite different from historical query data. Among them, historical booking data is the historical operation data of the airline, which is usually directly stored in the data warehouse (for example, Teradata data warehouse). The data is relatively complete and not easy to lose. In addition, compared with historical query data, the amount of historical booking data is relatively small, because usually in a booking process, users may make multiple queries, and users will make at least one query each time they complete a booking.

[0135] According to the booking time in the historical booking data, the month, date, hour, minute and day of the week of the booking time can be obtained, so as to perform group analysis on the historical booking data and explore the trend and / or seasonal (periodic) rules of users completing bookings based on flight data.

[0136] and Figure 1 Similarly to the method shown in , based on steps S210-S260, by processing the historical booking data of the user obtained from the data warehouse, the user's booking preferences can be analyzed, and the number of queries for the second flight data corresponding to the corresponding booking information can be predicted at a specified query time, so as to determine the number of refreshes for the flight data according to the predicted number of queries. Additionally, the booking information may include the second route information from the departure airport (or departure place) to the arrival airport (or arrival place) and the second number of days in advance from the departure date of the flight. In addition, the booking information may also include the itinerary type of the flight. It should be understood that the same booking time described herein may be the same in one or more of the number of months, days, hours, minutes, and days of the week in which the booking time is located.

[0137] Generally, completing a ticket booking operation requires at least one query operation, so the historical ticket booking data can also provide the corresponding entity content of the flight data to be queried similarly to the historical query data, and the ticket booking information can be similar to the parameters included in the query information described above. In addition, the number of historical ticket booking data included in the second set counted can be used as the number of historical queries of the second entity group corresponding to the second set.

[0138] Similar to the query information above, the booking information can also be used as a basis for distinguishing the categories of flight data. The predicted query times of the corresponding booking information (e.g., the second information) output at step S250 indicates the predicted query times of the flight data of the corresponding category. For example, the query times of the flight data with the second route information of "Beijing to Shanghai" and the second advance days of "4 days" at the specified query time can be predicted. It should be understood that when the booking information is the same as the query information (e.g., the first route information is the same as the second route information and the first advance days are the same as the second advance days), the categories of flight data corresponding to the corresponding booking information and the corresponding query information are the same. Moreover, the predicted query times for the same category of flight data obtained based on the historical data of the two may be different, and the refresh times calculated based on the historical data of the two may also be different. At this time, the prediction results of the two can be adjusted, as will be described in detail later.

[0139] Furthermore, based on the above Figure 1 Similar to the method described above, a time series prediction algorithm may also be used to determine the predicted query times for the flight data corresponding to the second information based on the specified query time. The historical query times for the flight data obtained based on the historical booking data conform to the trend changes and seasonal changes with the time series. The time series prediction algorithm may be used to predict the number of bookings that may be completed for the flight data in the future time series (i.e., the query time to be predicted) (i.e., indicating the predicted number of queries for the flight data). Similarly, the time series prediction algorithm may use a variety of prediction algorithms such as the Holt-Winters algorithm, the autoregressive (AR) time series prediction algorithm, the autoregressive integrated moving average (ARIMA) time series prediction algorithm, and the like.

[0140] In order to refresh the cached flight data in time and improve the response speed and timeliness of data when users query, the refresh number of corresponding flight data in the cached flight data can be determined according to the predicted possible query number of flight data corresponding to the second information.

[0141] In some embodiments, the refresh times of the flight data corresponding to the second information in each time period may be determined. In a non-limiting embodiment, the refresh times of each flight data in the time period corresponding to the specified hours may be determined. Alternatively, the time periods in hours may be combined or split according to needs to determine the refresh times of the corresponding flight data in a specific time period.

[0142] Specifically, refer to Figure 4 , the following steps can be performed respectively: at step S261, setting the second total refresh times; at step S262, counting the second prediction query times for each ticket booking information to obtain the second prediction query total times.

[0143] Among them, the refresh times of flight data corresponding to each booking information can be determined by the following steps respectively: at step S262a, when the total number of second prediction queries is greater than the total number of second refreshes, calculate the second ratio of the total number of second prediction queries to the total number of second refreshes, and multiply the second prediction query times by the second ratio to generate the second refresh times; at step S262b, when the total number of second prediction queries is not greater than the total number of second refreshes, the second prediction query times are used as the second refresh times.

[0144] In addition, as mentioned above, in some embodiments, the above steps may be performed for more than one specified consecutive hours. Alternatively, the above steps may be performed for a specified number of minutes to determine the number of refreshes of each flight data within a time period with a smaller time interval.

[0145] By using both historical query data and historical booking data to calculate the refresh times of corresponding flight data, more complete historical data can be used to fully explore the rules of user data. In some embodiments, the prediction results based on historical query data and historical booking data can be integrated and adjusted to provide more complete and accurate prediction results. On the basis of steps S110-S160 and steps S210-S260, Figure 5 As shown, the method for caching flight data according to another embodiment of the present disclosure may further include: at step S270, integrating the first refresh number and the second refresh number to generate a target refresh number for each flight data in the cached flight data at a specified query time. The first refresh number is generated based on historical query data, and the second refresh number is generated based on historical booking data. Generally, the integration of prediction results based on historical query data and historical booking data includes taking the intersection of the prediction results of the two to ensure that the calculated target refresh number is as accurate as possible.

[0146] Specifically, if Figure 6As shown, generating a target refresh number of each flight data in the cached flight data at a specified query time may include: when the first information and the second information are the same, only the flight data corresponding to the first information is retained in the cached flight data, and the larger of the first refresh number and the second refresh number is used as the target refresh number of the flight data corresponding to the first information (step S271); when the first information and the second information are different, both the flight data corresponding to the first information and the flight data corresponding to the second information are retained in the cached flight data, and the first refresh number and the second refresh number are used as the target refresh number of the flight data corresponding to the first information and the target refresh number of the flight data corresponding to the second information, respectively (step S272).

[0147] In a non-limiting embodiment, when the first information is the same as the second information, only the flight data corresponding to the second information may be retained in the cached flight data, and the larger of the first refresh number and the second refresh number may be used as the target refresh number of the flight data corresponding to the second information.

[0148] It should be understood that the route information and the number of days in advance in the flight data involved in the query and the booking may be different. Through the above steps, the refresh times of the flight data with different route information and different number of days in advance that the other party has not predicted can be supplemented to provide a more complete refresh number of flight data. In addition, when the route information and the number of days in advance in the flight data involved are the same, the refresh times of the flight data generated based on the historical query data and the flight data generated based on the historical booking data may be different. By comparing the respective prediction results and taking the larger refresh number as the target refresh number, the refresh times of the corresponding flight data in the cached flight data can be determined more reasonably, thereby improving the cache hit rate.

[0149] The refresh times of the flight data obtained based on the historical data may be too large. For example, for some flight data with high travel demand, the historical query times or historical ticket booking times are also large, which makes the final prediction result correspondingly large. In particular, it may be greater than the refresh times that the server can bear; in fact, there is no need to refresh these flight data too much, so it is necessary to comprehensively calculate and optimize the refresh times to avoid wasting server resources.

[0150] In some embodiments, after the prediction results generated based on the historical query data and the historical booking data are integrated, the refresh times of the corresponding route data can also be adjusted. Figure 5 According to another embodiment of the present disclosure, the method for caching flight data may further include: at step S280, adjusting the target refresh number based on the category of each flight data in the cached flight data to generate an optimized refresh number of the flight data.

[0151] In a non-limiting embodiment, for the refresh times of flight data in each time period (corresponding to each hour), the refresh times of flight data can be distributed to other flight data with different advance days from the flight departure date. Figure 7 As shown, generating the optimized refresh times of flight data may include: at step S281, classifying the flight data in the cached flight data that meets the preset category into a third set; at step S282, arranging the flight data in the third set in descending order according to the target refresh times, and for the flight data in the third set, setting the counter i=1, and cyclically performing the following steps S282a-S282f:

[0152] Determine whether the target refresh number of the i-th flight data is greater than the preset maximum refresh number (step S282a);

[0153] In response to the target refresh number of the i-th flight data being less than or equal to the preset maximum refresh number, exiting the loop (step S282b);

[0154] In response to the target refresh number of the i-th flight data being greater than the preset maximum refresh number, setting the target refresh number of the i-th flight data to the preset maximum refresh number, and calculating the i-th refresh number difference between the target refresh number of the i-th flight data and the preset maximum refresh number (step S282c);

[0155] Based on the ith refresh number difference and the preset number of flights n, n flight data that meet the preset category and have different advance days to the flight departure date are created, and a specified refresh number that is less than the preset maximum refresh number is assigned to the n flight data, wherein the sum of the specified refresh numbers of the n flight data is less than or equal to the ith refresh number difference (step S282d);

[0156] When i is equal to the total number of flight data in the third set, exit the loop (step S282e); and

[0157] The counter i is incremented by 1 (step S282f).

[0158] The preset categories may include third route information from the departure airport to the arrival airport and the itinerary type of the flight. In addition, the specified refresh times may be one, two, or other times, as long as the sum of the specified refresh times of the created flight data is less than or equal to the corresponding refresh times difference.

[0159] Further, in some embodiments, n flight data with different advance days can be created based on the advance days of the i-th flight data plus a random number that complies with a preset rule (eg, the random number increases by two times).

[0160] By adjusting the refresh times of flight data in each time period, part of the refresh times that are greater than the preset maximum refresh times can be allocated to the refresh times of other flight data with different lead times, so that the final refresh times are more reasonable and in line with reality. For example, based on historical data, it is obtained that "in the 08:00-09:00 time period, the flight data from Shanghai to Beijing with a lead time of 3 days is refreshed 20 times". After adjusting the refresh times (for example, the preset maximum refresh times are 10 times), it can be obtained that "in the 08:00-09:00 time period, the flight data from Shanghai to Beijing with a lead time of 3 days is refreshed 10 times; the flight data from Shanghai to Beijing with a lead time of 30 days is refreshed once; the flight data from Shanghai to Beijing with a lead time of 31 days is refreshed once; the flight data from Shanghai to Beijing with a lead time of 32 days is refreshed once; ... the flight data from Shanghai to Beijing with a lead time of 40 days is refreshed once."

[0161] In some embodiments, the refresh times of flight data in each time period can also be adjusted in other ways. For example, a threshold is set for the target refresh times corresponding to each route information, and when the predicted refresh times of a certain route information exceeds the threshold, the refresh times of flight data related to the route information can be allocated to the refresh times of flight data related to other route information.

[0162] After determining the target refresh times for the flight data in the cached flight data, the flight data can be refreshed in sequence. Figure 5 According to another embodiment of the present disclosure, the method for caching flight data may further include: at step S290, generating a refresh sequence table for cached flight data, and refreshing each flight data in the cached flight data based on the refresh sequence table. Among them, the refresh sequence table for the corresponding time period may be generated according to the specified query time, and in order to avoid frequent refreshes of the same target flight data within the time period. In a non-limiting embodiment, the refresh sequence table may be generated based on the principle of uniform refresh of each target flight number data. Specifically, as Figure 8 As shown, Figure 8 A schematic diagram of a process for generating a refresh sequence table in a method for caching flight data according to an embodiment of the present disclosure is shown. Step S290 may include:

[0163] Sort the cached flight data to get the refresh set, where flight data A1, A2, ..., A m According to its target refresh number n1, n2, ..., n m Arrange in descending order, m is the total number of categories of flight data in the refresh set (step S291);

[0164] The flight data A1 is used as an initial sequence table of length n1 (step S292);

[0165] When m<2, the initial sequence list is used as the refresh sequence list (step S293);

[0166] When m≥2, set counter j=2, and execute the following steps S294a-S294d (step S294) cyclically:

[0167] Calculate flight data A1 to A j-1 The target refresh number n1 to n j-1 The sum of n sum (Step S294a);

[0168] n sum / n j Round the flight data A to the interval number j Insert into the current refresh sequence list (step S294b);

[0169] When j is equal to the total number of categories m, exit the loop (step S294c); and

[0170] The counter j is incremented by 1 (step S294d).

[0171] The flight data may be classified by query information and / or booking information. Since the query information and booking information may provide parameters of the same attribute, the flight data may be directly classified by the parameters of the corresponding attribute. In a non-limiting embodiment, the flight data may be classified by route information and advance days, that is, at least one of the route information and advance days is different between flight data of different categories. It should be understood that the flight data may also be classified based on the itinerary type.

[0172] The following combination Fig. 9 The specific example shown describes the process of generating a refresh sequence table based on the above steps. For example, for a refresh sequence table such as "the flight data from Shanghai to Beijing with 3 days in advance (recorded as A1) is refreshed 10 times; the flight data from Shanghai to Beijing with 5 days in advance (recorded as A2) is refreshed 5 times; the flight data from Shanghai to Beijing with 10 days in advance (recorded as A3) is refreshed 2 times", a refresh sequence table 310 with a length of 10 can be generated based on A1 and its refresh times. By calculating the refresh interval number of A2 10 / 5=2, A2 is inserted into the refresh sequence table 310 with an interval number of 2 to generate a refresh sequence table 320. Then, by calculating the refresh interval number of A3 15 / 2=7 (rounded), A3 is inserted into the refresh sequence table 320 with an interval number of 7 to generate a refresh sequence table 330.

[0173] It should be understood that the process of adjusting the refresh times and generating a refresh sequence list for flight data generated using only historical query data or historical booking data is also applicable to the above-mentioned process of adjusting the target refresh times and generating a refresh sequence list for flight data generated based on both historical query data and historical booking data.

[0174] In a non-limiting embodiment, the generated refresh sequence table may be transmitted in the form of a message queue so that the front-end system can read and sequentially refresh the corresponding flight data in the cached flight data.

[0175] Therefore, the method for caching flight data according to the present disclosure can determine the refresh times of corresponding flight data in cached flight data based on the user's historical data, so as to dynamically refresh the cached flight data in a timely manner, so that when the user makes a query, the corresponding flight data is already included in the cached data as much as possible. This method improves the cache hit rate, reduces the pressure on the background server, improves the response time, improves the user experience and satisfaction, and enhances the brand image of the airline.

[0176] In another aspect, the present disclosure also provides a device for caching flight data. Fig.10 , which shows a schematic block diagram of an apparatus 400 (hereinafter referred to as apparatus 400) for caching flight data according to some embodiments of the present disclosure. Fig.10 As shown, the device 400 includes an acquisition module 410, a processing module 420, a prediction module 430 and a refresh module 440. It is understood that the actual device may also include other components, but in order to avoid blurring the key points of the present disclosure, these other components are not discussed herein and are not shown in the drawings.

[0177] The acquisition module 410 may be configured to acquire historical query data for flight data, wherein each historical query data includes an entity group of query information and query time. In some embodiments, the acquisition module 410 may also be configured to acquire historical ticket booking data for flight data, wherein each historical ticket booking data includes an entity group of ticket booking information and ticket booking time.

[0178] The processing module 420 may be configured to divide the historical query data with the same query information and query time into a first set, wherein the query information includes the first route information from the departure airport to the arrival airport and the first number of days in advance to the departure date. The processing module 420 may also be configured to count the number of historical query data included in the first set as the number of historical queries of the first entity group corresponding to the first set. The processing module 420 may also be configured to generate a first sample set for multiple first sets of the first information based on the query information, wherein the first sample set includes sample data indicating the relationship between the query time and the number of historical queries of the first entity group.

[0179] In some embodiments, the processing module 420 may be further configured to divide the historical booking data with the same booking information and booking time into a second set, wherein the booking information includes second route information from the departure airport to the arrival airport and a second number of days in advance to the departure date. The processing module 420 may be further configured to count the number of historical booking data included in the second set as the number of historical queries of the second entity group corresponding to the second set. The processing module 420 may be further configured to generate a second sample set for multiple second sets of second information based on the booking information, wherein the second sample set includes sample data indicating the relationship between the booking time and the number of historical queries of the second entity group.

[0180] The prediction module 430 may be configured to train the first prediction model using the first sample set, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input. In some embodiments, the prediction module 430 may also be configured to train the second prediction model using the second sample set, so that the second prediction model can output a second predicted query number for the second information when a specified query time is input.

[0181] The refresh module 440 may be configured to determine a first refresh number of flight data corresponding to the first information in the cached flight data at a specified query time based on the first predicted query number. In some embodiments, the refresh module 440 may also be configured to determine a second refresh number of flight data corresponding to the second information in the cached flight data at a specified query time based on the second predicted query number; and further, integrate the first refresh number and the second refresh number to generate a target refresh number of each flight data in the cached flight data at a specified query time.

[0182] Various embodiments of the apparatus 400 are similar to the various embodiments of the aforementioned method for caching flight data, and therefore reference may be made to the aforementioned description of the various embodiments of the method, which will not be repeated herein.

[0183] The present disclosure also provides a device for caching flight data, which may include one or more processors and a memory storing computer-executable instructions. When the computer-executable instructions are executed by the one or more processors, the one or more processors execute the method for caching flight data according to any of the aforementioned embodiments of the present disclosure.

[0184] like Fig.11As shown, a device 500 for caching flight data (hereinafter referred to as device 500) includes (one or more) processors 510 and a memory 520 storing computer executable instructions, which, when executed by the processor 510, causes the processor 510 to perform the method for caching flight data according to any of the aforementioned embodiments of the present disclosure. The processor 510 may be, for example, a central processing unit (CPU) of the device 500. The processor 510 may be any type of general-purpose processor, or may be a processor specifically designed for caching flight data, such as an application-specific integrated circuit ("ASIC"). The memory 520 may include various computer-readable media accessible by the processor 510. In various embodiments, the memory 520 described herein may include volatile and non-volatile media, removable and non-removable media. For example, the memory 520 may include any combination of the following: random access memory ("RAM"), dynamic RAM ("DRAM"), static RAM ("SRAM"), read-only memory ("ROM"), flash memory, cache memory, and / or any other type of non-transitory computer-readable media. The memory 520 may store instructions that, when executed by the processor 510 , enable the processor 510 to perform the method for caching flight data according to any of the aforementioned embodiments of the present disclosure.

[0185] The present disclosure also provides a non-volatile storage medium having computer executable instructions stored thereon, which, when executed by one or more processors, enables the one or more processors to execute the method for caching flight data according to any of the foregoing embodiments of the present disclosure.

[0186] The present disclosure also provides a computer program product, which may include computer executable instructions. When the computer executable instructions are executed by one or more processors, the one or more processors may perform the method for caching flight data as described above.

[0187] Computer executable instructions can be any set of instructions to be executed directly by one or more processors, such as machine code, or any set of instructions to be executed indirectly, such as a script. The terms "instructions", "applications", "processes", "steps" and "programs" herein are used interchangeably herein. Computer executable instructions can be stored in an object code format for direct processing by one or more processors, or stored as a script or collection of independent source code modules in any other computer language, including those interpreted on demand or compiled in advance. Computer executable instructions can include instructions that cause one or more processors to act as neural networks. Other parts of this article explain the functions, methods and routines of computer executable instructions in more detail.

[0188] Fig.12An exemplary configuration of a computing device that can implement an embodiment of the present disclosure is shown. The computing device includes one or more processors 601, an input / output interface 605 connected to the processor 601 via a bus 604, and memories 602 and 603 connected to the bus 604. In some embodiments, the memory 602 may be a read-only memory (ROM), and the memory 603 may be a random access memory (RAM).

[0189] Processor 601 may be any kind of processor, and may include, but is not limited to, one or more general-purpose processors or special-purpose processors (such as special-purpose processing chips). Memories 602 and 603 may be any non-transitory storage device that can implement data storage, and may include, but is not limited to, disk drives, optical storage devices, solid-state memories, floppy disks, flexible disks, hard disks, tapes or any other magnetic media, compressed disks or any other optical media, cache memories and / or any other storage chips or modules, and / or any other media from which a computer can read data, instructions and / or codes.

[0190] The bus 604 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0191] In some embodiments, the input / output interface 605 is connected to an input unit 606 configured by an input device such as a keyboard and a mouse for a user to input an operation command, an output unit 607 that outputs a processing operation screen and an image of a processing result to a display device, a storage unit 608 including a hard disk drive and the like for storing programs and various data, and a communication unit 609 including a local area network (LAN) adapter and the like and performing communication processing via a network represented by the Internet. In addition, a drive 610 that reads and writes data from and on a removable storage medium 611 is connected.

[0192] Various aspects, embodiments, implementations or features of the foregoing embodiments may be used alone or in any combination. Various aspects of the foregoing embodiments may be implemented by software, hardware or a combination of hardware and software.

[0193] For example, the foregoing embodiments may be embodied as computer readable code on a computer readable medium. A computer readable medium is any data storage device that can store data that can thereafter be read by a computer system. Examples of computer readable media include read-only memory, random access memory, CD-ROM, DVD, magnetic tape, hard drive, solid state drive, and optical data storage device. The computer readable medium may also be distributed in a network coupled computer system so that the computer readable code is stored and executed in a distributed manner.

[0194] For example, the aforementioned embodiments may be in the form of hardware circuits. The hardware circuits may include any combination of combinational logic circuits, clock storage devices (such as floppy disks, flip-flops, latches, etc.), finite state machines, memories such as static random access memories or embedded dynamic random access memories, custom designed circuits, programmable logic arrays, etc.

[0195] In one embodiment, hardware circuits according to the present disclosure may be implemented by coding and designing one or more integrated circuits using a hardware description language (HDL) such as Verilog or VHDL, or in combination using discrete circuits.

[0196] One or more exemplary embodiments of the present disclosure are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0197] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present disclosure does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0198] Although one or more embodiments of the present disclosure provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment).

[0199] The terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, product or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, product or apparatus. In the absence of further restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or apparatus comprising the elements. For example, if the words "first", "second" and the like are used to indicate names, they do not indicate any particular order.

[0200] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more embodiments of the present disclosure, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0201] The present disclosure is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0202] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a particular manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device that implements the functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram.

[0203] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of the present disclosure may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0204] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0205] The same or similar parts between the various embodiments of the present disclosure can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. In the description of the present disclosure, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present disclosure, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present disclosure and the features of the different embodiments or examples without contradiction.

[0206] In addition, when used in the present disclosure, the words "herein," "above," "below," "hereunder," "above," and words of similar meaning shall refer to the present disclosure as a whole rather than to any particular portion of the present disclosure. Furthermore, unless expressly stated otherwise or understood otherwise in the context of use, conditional language used herein, such as "may," "might," "for example," "such as," and the like, is generally intended to express that certain embodiments include, while other embodiments do not include, certain features, elements, and / or states. Thus, such conditional language is generally not intended to imply that one or more embodiments require features, elements, and / or states in any way, or whether such features, elements, and / or states are included or performed in any particular embodiment.

[0207] The above description is only an example of one or more embodiments of the present disclosure, and is not intended to limit one or more embodiments of the present disclosure. For those skilled in the art, one or more embodiments of the present disclosure may have various changes and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims.

Claims

1. A method for caching flight data, characterized in that: The method comprises: Obtain historical query data and historical ticket booking data for flight data, wherein each historical query data includes an entity group of query information and query time, and each historical ticket booking data includes an entity group of booking information and booking time; The historical query data with the same query information and query time are divided into a first set, and the historical ticket booking data with the same ticket booking information and ticket booking time are divided into a second set, wherein the query information includes the first route information from the departure airport to the arrival airport and the first number of days before the departure date, and the ticket booking information includes the second route information from the departure airport to the arrival airport and the second number of days before the departure date; Counting the number of historical query data included in the first set as the number of historical query times of the first entity group corresponding to the first set, and counting the number of historical ticket booking data included in the second set as the number of historical query times of the second entity group corresponding to the second set; Generate a first sample set for a plurality of first sets of first information based on the query information, and generate a second sample set for a plurality of second sets of second information based on the booking information, wherein the first sample set includes sample data indicating a relationship between a query time and a historical query count of the first entity group, and the second sample set includes sample data indicating a relationship between a booking time and a historical query count of the second entity group; Using the first sample set to train the first prediction model, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input, and using the second sample set to train the second prediction model, so that the second prediction model can output a second predicted query number for the second information when the specified query time is input; and Determine, based on the first predicted query number, a first refresh number of the flight data corresponding to the first information in the cached flight data at the specified query time, and determine, based on the second predicted query number, a second refresh number of the flight data corresponding to the second information in the cached flight data at the specified query time; The first refresh number and the second refresh number are integrated to generate a target refresh number of each flight data in the cached flight data at a specified query time.

2. The method according to claim 1, characterized in that Determining a first refresh number of the flight data corresponding to the first information at a specified query time includes: For the specified query time, perform the following operations respectively: The first total refresh times are set, and the first predicted query times for each query information are counted to obtain the first predicted query total times, where: When the first predicted query total number is greater than the first refresh total number, calculating a first ratio of the first predicted query total number to the first refresh total number, and multiplying the first predicted query number by the first ratio to generate a first refresh number; and When the total number of first prediction queries is not greater than the total number of first refreshes, the first prediction query number is used as the first refresh number.

3. The method according to claim 1, characterized in that The target refresh times for each flight data in the generated cached flight data at the specified query time include: When the first information is the same as the second information, only the flight data corresponding to the first information is retained in the cached flight data, and the larger of the first refresh number and the second refresh number is used as the target refresh number of the flight data corresponding to the first information; When the first information is different from the second information, both the flight data corresponding to the first information and the flight data corresponding to the second information are retained in the cached flight data, and the first refresh number and the second refresh number are used as the target refresh number of the flight data corresponding to the first information and the target refresh number of the flight data corresponding to the second information respectively.

4. The method according to claim 1, characterized in that: Determining a second refresh number of the flight data corresponding to the second information in the cached flight data at the specified query time includes: For the specified query time, perform the following operations respectively: The second total refresh times are set, and the second prediction query times for each ticket booking information are counted to obtain the second total prediction query times, where: When the second predicted query total number is greater than the second refresh total number, calculating a second ratio of the second predicted ticket booking total number to the second refresh total number, and multiplying the second predicted query number by the second ratio to generate a second refresh number; When the second prediction query total number is not greater than the second refresh total number, the second prediction query number is used as the second refresh number.

5. The method according to claim 1, characterized in that The method further comprises: The target refresh number is adjusted based on the category of each flight data in the cached flight data to generate an optimized refresh number of the flight data.

6. The method according to claim 5, characterized in that Optimized refresh times for generating flight data include: Classifying the flight data in the cached flight data that conform to the preset category into a third set, wherein the preset category includes third route information from the departure airport to the arrival airport and the itinerary type of the flight; Arrange the flight data in the third set in descending order according to the target refresh times, and for the flight data in the third set, set the counter i=1, and perform the following operations cyclically: Determine whether the target refresh number of the i-th flight data is greater than the preset maximum refresh number; In response to the target refresh number of the i-th flight data being less than or equal to the preset maximum refresh number, exiting the loop; In response to the target refresh number of the i-th flight data being greater than the preset maximum refresh number, setting the target refresh number of the i-th flight data to the preset maximum refresh number, and calculating the i-th refresh number difference between the target refresh number of the i-th flight data and the preset maximum refresh number; Based on the i-th refresh number difference and the preset number of flights n, n flight data that meet the preset category and have different numbers of days before the flight departure date are created, and a specified refresh number that is less than the preset maximum refresh number is assigned to the n flight data, wherein the sum of the specified refresh numbers of the n flight data is less than or equal to the i-th refresh number difference; When i is equal to the total number of flight data in the third set, the loop is exited; and Increment counter i by 1.

7. The method according to claim 1, characterized in that The method further comprises: A refresh sequence table of cached flight data is generated, and each flight data in the cached flight data is refreshed based on the refresh sequence table.

8. The method according to claim 7, characterized in that The refresh sequence table for generating cached flight data includes: Sort the cached flight data to get the refresh set, where flight data A1, A2, ..., A m According to its target refresh number n1, n2, ..., n m Arranged in descending order, m is the total number of categories of flight data in the refresh set; The flight data A1 is used as the initial sequence list with a length of n1; When m<2, the initial sequence list is used as the refresh sequence list; When m≥2, let counter j=2 and perform the following operations cyclically: Calculate flight data A1 to A j-1 The target refresh number n1 to n j-1 The sum of n sum ; n sum / n j Round the flight data A to the interval number j Insert into the current refresh sequence table; When j equals the total number of categories m, the loop is exited; and Increment counter j by 1.

9. A device for caching flight data, characterized in that: The device comprises: An acquisition module is configured to acquire historical query data and historical ticket booking data for flight data, wherein each historical query data includes an entity group of query information and query time, and each historical ticket booking data includes an entity group of booking information and booking time; The processing module is configured as follows: The historical query data with the same query information and query time are divided into a first set, and the historical ticket booking data with the same ticket booking information and ticket booking time are divided into a second set, wherein the query information includes the first route information from the departure airport to the arrival airport and the first number of days before the departure date, and the ticket booking information includes the second route information from the departure airport to the arrival airport and the second number of days before the departure date; Counting the number of historical query data included in the first set as the number of historical query times of the first entity group corresponding to the first set, and counting the number of historical ticket booking data included in the second set as the number of historical query times of the second entity group corresponding to the second set; Generate a first sample set for a plurality of first sets of first information based on the query information, and generate a second sample set for a plurality of second sets of second information based on the booking information, wherein the first sample set includes sample data indicating a relationship between a query time and a historical query count of the first entity group, and the second sample set includes sample data indicating a relationship between a booking time and a historical query count of the second entity group; The prediction module is configured as follows: Using the first sample set to train the first prediction model, so that the first prediction model can output a first predicted query number for the first information when a specified query time is input; Using the second sample set to train the second prediction model, so that the second prediction model can output a second predicted query number for the second information when a specified query time is input; and The refresh module is configured as: Determining a first refresh number of the flight data corresponding to the first information in the cached flight data at a specified query time according to the first predicted query number; Determining a second refresh number of the flight data corresponding to the second information in the cached flight data at the specified query time according to the second predicted query number; The first refresh number and the second refresh number are integrated to generate a target refresh number of each flight data in the cached flight data at a specified query time.

10. A device for caching flight data, characterized in that: The device comprises: Processor; and A memory storing computer executable instructions which, when executed by the processor, cause the processor to perform the method for caching flight data according to any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium has computer-executable instructions stored thereon, which when executed by one or more processors cause the one or more processors to perform the method for caching flight data according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product comprises computer executable instructions which, when executed by one or more processors, cause the one or more processors to perform the method for caching flight data according to any one of claims 1 to 8.