Ticket business processing method and device
By obtaining update events and prediction models to determine the expiration time of the ticket cache, the problems of inaccurate ticket quotations and high operating costs are solved, and the accuracy and cost-effectiveness of the cache is achieved.
Patent Information
- Application Number
- CN202510467914.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-14
AI Technical Summary
In the prior art, improper setting of expiration time of ticket quotation cache leads to inaccurate quotation or increased operating costs.
By obtaining update events, query information is determined, the pre-trained prediction model is used to obtain the initial expiration time of the target cache, and the expiration time of the cache is determined based on the validity of the initial expiration time, and the expiration time is adjusted in combination with predetermined algorithm rules.
Improve the accuracy of ticketing quotation caching and reduce operating costs.
Smart Images

Figure CN120371884A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of order processing, and particularly to a ticket processing method and apparatus. Background Art
[0002] The ticket pricing system plays a crucial role in modern travel services, which can provide users with instant and accurate ticket price information. Especially in the aviation industry, the ticket business platform obtains the latest quotes by docking with multiple supplier interfaces to meet users' needs for flight fare information. Currently, in order to improve the response speed and alleviate the problem of long query time of the supplier interface, the caching technology is widely adopted in the industry.
[0003] In the prior art, a fixed expiration time strategy is generally adopted to manage the update period of cached data. However, when the cache expiration time is set relatively long, although the request frequency to the supplier can be reduced, it may also lead to inaccurate quotes; on the contrary, shortening the cache validity period will increase the number of real-time queries, resulting in an increase in operating costs. Summary of the Invention
[0004] In view of this, an object of the embodiments of the present invention is to provide a ticket processing method and apparatus, which can improve the accuracy of ticket price caching and reduce operating costs.
[0005] In a first aspect, an embodiment of the present invention provides a ticket processing method, the method comprising:
[0006] Obtaining an update event;
[0007] Determining query information corresponding to the update event, the query information including at least one of a departure place, a destination, and a departure time;
[0008] Obtaining a query result according to the query information and storing it in a target cache;
[0009] Obtaining an initial expiration time corresponding to the target cache through a pre-trained prediction model;
[0010] Determining the validity of the initial expiration time;
[0011] In response to the initial expiration time being valid, determining the initial expiration time as the expiration time of the target cache;
[0012] In response to the initial expiration time being invalid, obtaining the expiration time of the target cache according to a predetermined algorithm rule.
[0013] In some embodiments, the obtaining an update event includes:
[0014] Receiving a query request from a user;
[0015] Generate an update event in response to the absence of a valid cache corresponding to the query request.
[0016] In some embodiments, the obtaining of the update event includes:
[0017] Generate an update event in response to detecting cache invalidation.
[0018] In some embodiments, the query result includes the quotes of tickets.
[0019] In some embodiments, the obtaining of the initial expiration time corresponding to the target cache by a pre-trained prediction model includes:
[0020] Obtain the input features corresponding to the target cache, where the input features include fixed features and variable features, the fixed features include at least one of route, airline, flight number, class of service, cabin code, and departure time, and the variable features include at least one of the scheduled time and the difference between the scheduled departure time and the actual departure time;
[0021] Keep the fixed features unchanged and adjust the variable features to obtain the scheduled time when the number of seats in each class is zero;
[0022] Determine a plurality of candidate expiration times based on the difference between the scheduled time when the number of seats in each class is zero and the current time;
[0023] Determine the minimum value among the candidate expiration times as the initial expiration time.
[0024] In some embodiments, the determination of the validity of the initial expiration time includes:
[0025] Obtain a pre-determined time interval;
[0026] In response to the initial expiration time being within the time interval, determine that the initial expiration time is valid;
[0027] In response to the initial expiration time not being within the time interval, determine that the initial expiration time is invalid.
[0028] In some embodiments, the obtaining of the expiration time of the target cache according to a predetermined algorithm rule includes:
[0029] Obtain historical order data;
[0030] Obtain reference information based on the historical order data, where the reference information includes a set of reference parameters and a reference expiration time, and the set of reference parameters includes a reference route dimension value, a reference scheduled time dimension value, and a reference difference between the scheduled departure time and the actual departure time dimension value;
[0031] Determine at least one set of target parameters corresponding to the target cache;
[0032] Determine the expiration time of the target cache according to the reference parameter set, the reference expiration time, and the target parameter set.
[0033] In some embodiments, the target parameter set is a parameter set corresponding to the current moment and at least one consecutive moment after the current moment.
[0034] In some embodiments, the determining the expiration time of the target cache according to the reference parameter set, the reference expiration time, and the target parameter set includes:
[0035] Determine the ratio of each parameter in the reference parameter set to the corresponding parameter in the target parameter set;
[0036] Perform a weighted sum of the ratios of each parameter to obtain the order quantity ratio corresponding to the target parameter set;
[0037] Obtain the average value of the order quantity ratios of multiple target parameter sets;
[0038] Determine the expiration time of the target cache according to the product of the average value of the order quantity ratio and the reference expiration time.
[0039] In some embodiments, the determining the expiration time of the target cache according to the product of the average value of the order quantity ratio and the reference expiration time includes:
[0040] In response to the product of the average value of the order quantity ratio and the reference expiration time being within the time interval, use the product of the average value of the order quantity ratio and the reference expiration time as the expiration time of the target cache;
[0041] In response to the product of the average value of the order quantity ratio and the reference expiration time being greater than the maximum value of the time interval, use the maximum value of the time interval as the expiration time of the target cache;
[0042] In response to the product of the average value of the order quantity ratio and the reference expiration time being less than the minimum value of the time interval, use the minimum value of the time interval as the expiration time of the target cache.
[0043] In some embodiments, the method further includes:
[0044] In response to the target cache reaching the expiration time, invalidate the target cache.
[0045] In a second aspect, an embodiment of the present invention provides a ticket processing device, and the device includes:
[0046] An event acquisition unit for acquiring update events;
[0047] A query information acquisition unit, configured to determine query information corresponding to the update event, where the query information includes at least one of a departure place, a destination, a departure time, and a query time;
[0048] A cache acquisition unit, configured to acquire a query result according to the query information and store it in a target cache;
[0049] An initial expiration time acquisition unit, configured to acquire an initial expiration time corresponding to the target cache through a pre-trained prediction model;
[0050] A validity determination unit, configured to determine the validity of the initial expiration time;
[0051] A first time determination unit, configured to, in response to the initial expiration time being valid, determine the initial expiration time as the expiration time of the target cache;
[0052] A second time determination unit, configured to, in response to the initial expiration time being invalid, acquire the expiration time of the target cache according to a predetermined algorithm rule.
[0053] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is configured to store one or more computer program instructions, and wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect.
[0054] In a fourth aspect, an embodiment of the present invention provides a computer program product, where the computer program product includes a computer program, and when the computer program runs on a computer, the computer executes the method as described in the first aspect above.
[0055] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which computer program instructions are stored, and the computer program instructions, when executed by a processor, implement the method as described in the first aspect.
[0056] The technical solution of the embodiment of the present invention is to obtain an update event, determine query information corresponding to the update event, acquire a query result according to the query information and store it in a target cache, acquire an initial expiration time corresponding to the target cache through a pre-trained prediction model, determine the validity of the initial expiration time, in response to the initial expiration time being valid, determine the initial expiration time as the expiration time of the target cache, and in response to the initial expiration time being invalid, acquire the expiration time of the target cache according to a predetermined algorithm rule. Thereby, the accuracy of the ticket price quote cache can be improved and the operation cost can be reduced. Description of the Drawings
[0057] Through the following description of the embodiments of the present invention with reference to the accompanying drawings, the above and other objects, features, and advantages of the present invention will become clearer. In the drawings:
[0058] Figure 1 is a schematic diagram of a ticket processing system according to an embodiment of the present invention;
[0059] Figure 2 is a flowchart of a ticket processing method according to an embodiment of the present invention;
[0060] Figure 3 is a flowchart of obtaining a pre-trained prediction model according to an embodiment of the present invention;
[0061] Figure 4 is a flowchart of obtaining an initial expiration time according to an embodiment of the present invention;
[0062] Figure 5 is a flowchart of obtaining an expiration time according to an embodiment of the present invention;
[0063] Figure 6 is a schematic diagram of the order volume of an embodiment of the present invention;
[0064] Figure 7 is a schematic diagram of the order volume of another embodiment of the present invention;
[0065] Figure 8 is a schematic diagram of the order volume of yet another embodiment of the present invention;
[0066] Figure 9 is a flowchart of determining the expiration time of a target cache according to an embodiment of the present invention;
[0067] Figure 10 is a flowchart of determining the expiration time of a target cache according to another embodiment of the present invention;
[0068] Figure 11 is a schematic diagram of a ticket processing apparatus according to an embodiment of the present invention;
[0069] Figure 12 is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Embodiments
[0070] The following describes the present application based on embodiments, but the present application is not limited to these embodiments. In the following detailed description of the present application, some specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. In order to avoid obscuring the essence of the present application, well-known methods, processes, procedures, elements, and circuits are not described in detail.
[0071] In addition, those of ordinary skill in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0072] Unless the context clearly requires otherwise, words such as "including" and "comprising" in the entire application document shall be construed in an inclusive sense rather than an exclusive or exhaustive sense; that is, it is the meaning of "including but not limited to".
[0073] In the description of this application, it should be understood that terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "a plurality" is two or more.
[0074] For the solutions described in this specification and the embodiments, if they involve the processing of personal information, they will be processed on the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract, etc.), and will only be processed within the specified or agreed scope. If the user refuses to process personal information other than the necessary information required for the basic functions, it will not affect the user's use of the basic functions.
[0075] Figure 1 It is a schematic diagram of the ticket processing system according to an embodiment of the present invention. As Figure 1 shown, the ticket processing system according to an embodiment of the present invention includes a user terminal 1, a service server 2, a supplier server 3, and a network 4.
[0076] Among them, the user terminal 1 is a device used by the user to initiate a ticket query request. It can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, or other devices that can access the Internet and run corresponding application programs or browsers. The user inputs query conditions (such as the departure place, destination, date, etc.) through these devices, and then generates a query request and sends it to the service server 2. In addition, the user terminal 1 is also used to receive and display the query results received from the service server 2, providing an intuitive operation interface and information feedback for the user.
[0077] The service server 2 is used to receive query requests from the user terminal 1, process these requests, and return corresponding query results to the user terminal. The service server 2 has the ability to manage the cache. First, it tries to obtain data that meets the query request from the local cache. If there is no valid data in the cache, the service server 2 will send a request to the supplier server 3 to obtain the latest information. The service server 2 is also used to update the data in the cache to ensure that subsequent similar queries can be responded to more quickly, thereby improving the overall service efficiency.
[0078] The supplier server 3 is a platform for ticket suppliers such as airlines and railway companies, used to store the latest ticket prices, seat availability, and other relevant information. When the business server 2 cannot obtain valid data from the cache, it will initiate a query request to the supplier server 3. The supplier server 3 performs a query operation based on the request parameters and returns the latest ticket information to the business server 2. Since the supplier server 3 is directly associated with the actual ticket resources, the information it provides has the highest accuracy and real-time performance.
[0079] The network 4 is used for the exchange of information and / or data among the user terminal 1, the business server 2, and the supplier server 3. Among them, the network 4 can be any type of wired or wireless network, or a combination of them. In some embodiments, the network 4 may include a wired network, a wireless network, an optical fiber network, a telecommunication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, etc., or any combination thereof. In some embodiments, the network 5 may include one or more network access points. For example, the network 4 may include a wired or wireless network access point, such as a base station and / or a network switching node, and one or more components of the data processing system can be connected to the network through this access point to exchange data and / or information.
[0080] During the ticket query process, first, the user initiates a query request through the user terminal 1, and this request is transmitted to the business server 2 via the network 4. After receiving the query request, the business server 2 will first attempt to obtain the corresponding query result from the cache. If there is valid data in the cache, that is, the cache has not expired and contains results that match the query conditions, the business server 2 will directly extract this information from the cache and quickly return the query result to the user terminal 1 via the network 4, thus achieving a quick response to the user's query needs.
[0081] However, in some cases, such as when no valid data meeting the query criteria is found in the cache (e.g., cache expiration or no relevant records), the business server 2 needs to send a request to the supplier server 3 to obtain the latest ticket price quotation information. After receiving the request, the supplier server 3 performs the corresponding query operation and returns the latest obtained ticket price quotation information to the business server 2. Subsequently, the business server 2 not only sends this information back to the user terminal 1 via the network 4 to meet the user's immediate query needs, but also updates the local cache based on the query results, so that the same or similar queries in the future can be responded to more quickly, while improving the overall query efficiency and service quality.
[0082] Figure 2 is a flowchart of the ticket processing method according to an embodiment of the present invention. Figure 2 The ticket processing method shown is applicable to a business server and specifically includes the following steps:
[0083] Step S100, obtain an update event.
[0084] In this embodiment, the update event is an event that requires creating a cache.
[0085] In an alternative implementation, the update event can be a passively triggered update event, and the passively triggered update event is an update event triggered by the business server based on the user's query request. Specifically, the business server receives the user's query request, including at least one of the departure location, destination, and departure time. Query the cache corresponding to the query request in the existing cache. In response to the existence of a valid cache corresponding to the query request, generate a query result according to the valid cache and send the query result to the user terminal. In response to the non-existence of a valid cache corresponding to the query request, it indicates that a cache needs to be created, and an update event is generated. Among them, when each cache is generated, it will be bound to information such as the departure location, destination, and departure time. Thus, the business server can find the corresponding cache according to the user's query request.
[0086] In another alternative implementation, the update event can be an actively triggered update event, and the actively triggered update event is an update event actively triggered by the business server according to the status of the existing cache. Specifically, the business server needs to maintain all caches, and each cache has an expiration time. When the cache reaches the expiration time, it means that the information in the corresponding cache is less accurate. Thus, the business server can select a part of the hot caches from all the caches. For these hot caches, when they reach the expiration time, they are actively updated, that is, an update event is generated. Among them, the hot caches can be all the caches, or a part of the caches can be selected according to a predetermined rule. For example, the caches with a higher query frequency are selected as the hot caches.
[0087] Step S200: Determine the query information corresponding to the update event.
[0088] In this embodiment, the query information includes at least one of the departure location, destination, and departure time.
[0089] For a passively triggered update event, the query information is determined according to a query request.
[0090] For an actively triggered update event, the query information is determined according to the information bound to the cache corresponding to the update event. Specifically, when the business server generates each cache, it binds it to information such as the departure location, destination, and departure time. Thus, after the business server obtains an update event triggered by the main point, it determines the cache corresponding to the update event triggered by the main point, and then determines the information bound to it according to the cache, and thus can obtain information such as the departure location, destination, and departure time.
[0091] Step S300: Obtain a query result according to the query information and store it in a target cache.
[0092] In this embodiment, the query result includes information such as ticket prices. After the business server obtains the query information, it obtains the query result from the supplier server according to the query information. The query result includes the ticket prices of each flight that meets the query information. Specifically, assume that the departure location in the query information is City A, the destination is City B, and the departure date is xxxx year x month x day. Then the business server queries the information of all flights from City A to City B on xxxx year x month x day from the supplier server. The flight information includes flight number, remaining seat quantity, seat class, departure time, arrival time, transfer station, price, and other information. At the same time, a target cache corresponding to the query information is established, and this information is stored in the target cache as the query result.
[0093] Specifically, when the business server starts, an empty cache container is initialized. The cache container can store multiple cache entries, and each cache entry can store data in the form of a key-value pair (Key-Value) for quick search and access. Among them, the key (Key) is generated from the query information, such as a unique identifier composed of information such as the user's departure location, destination, and departure time. The value (Value) is the corresponding query result, including flight number, remaining seat quantity, seat class, departure time, arrival time, transfer station, price, and other information. After obtaining the query result according to the query information, a cache entry is generated based on the query information and the query result and stored in the cache container.
[0094] Step S400: Obtain the initial expiration time corresponding to the target cache through a pre-trained prediction model.
[0095] In this embodiment, in order to ensure the accuracy of the data in the cache, an expiration time needs to be set for each cache entry. If the expiration time of the cache is set too long, the accuracy of the quotation will be affected, which will affect the user's reservation experience; if it is set too short, the real-time requests will be frequent and the response speed will be slow, which will also affect the user's search experience. Therefore, the embodiment of the present invention obtains a pre-trained prediction model, and further obtains the initial expiration time corresponding to the target cache through the pre-trained prediction model.
[0096] Figure 3 It is a flowchart of obtaining a pre-trained prediction model according to an embodiment of the present invention. As Figure 3 shown, obtaining a pre-trained prediction model includes the following steps:
[0097] Step S411, obtain a training sample set.
[0098] In this embodiment, historical data related to tickets is obtained, and then a training sample set is generated according to the historical data. The training sample set includes a plurality of training samples, and each training sample includes input features and labels.
[0099] Among them, the input features include flight route, airline, flight number, class, class code, departure time, reservation time, time difference between scheduled flight and actual flight, etc., and the label is the number of seats in the class. Among them, the class is the class level of the seat.
[0100] Step S412, determine an initial prediction model.
[0101] In this embodiment, a neural network model based on a Multilayer Perceptron (MLP) is selected as the prediction model to obtain an initial prediction model, that is, an untrained model.
[0102] Among them, the prediction model based on a Multilayer Perceptron (MLP) is a feedforward artificial neural network model, including an input layer, at least one hidden layer, and an output layer. Each layer is fully connected to the next layer, which means that each node will pass information to all nodes in the next layer.
[0103] Step S413, obtain the predicted number of seats in the class according to the input features in the training sample through the initial prediction model.
[0104] In this embodiment, the input features in the training sample are provided to the initial prediction model, and the initial prediction model obtains the predicted number of seats in the class according to the input features in the training sample.
[0105] Among them, the input layer is used to receive external input data, that is, input features, and the number of nodes in the input layer depends on the number of features of the input data.
[0106] The hidden layer is located between the input layer and the output layer, and there can be one or more. The number of hidden layers and the number of nodes in each layer are hyperparameters of the model, which can be adjusted according to specific problems to optimize performance. The hidden layer can automatically learn useful feature representations from the input features. Each layer can be regarded as extracting abstract features at different levels of the data.
[0107] The output layer is used to generate the final prediction result according to the feature representation learned by the hidden layer, that is, to predict the number of cabin seats.
[0108] In some embodiments, the predicted number of cabin seats is the number of each cabin seat. That is, assuming a flight has 50 cabin seats, the predicted number of cabin seats output by the prediction model includes 50 values, and the value of each is 0 or 1. Specifically, the output layer can calculate the probability value of the existence of each cabin seat, and the value of the probability is greater than or equal to 0 and less than or equal to 1. The probability value represents the probability of the existence of the cabin seat, that is, the probability of not being reserved. The closer the value is to 1, the greater the possibility that the cabin seat is not reserved. The closer the value is to 0, the greater the possibility that the cabin seat has been reserved. Then, the probability value is mapped to 0 or 1. For example, if the probability value is less than 0.5, it is mapped to 0, and if the probability value is greater than or equal to 0.5, it is mapped to 1.
[0109] Step S414, adjust the initial prediction model according to the predicted number of cabin seats and the label to obtain the pre-trained prediction model.
[0110] In this embodiment, the initial prediction model is optimized and adjusted according to the difference between the predicted number of cabin seats and the actual label until a fully trained prediction model is obtained. By comparing the model prediction value with the true label, technical means such as the backpropagation algorithm can be used to update the model weights and reduce the prediction error. This process is repeated multiple times until the model converges, that is, the prediction accuracy reaches the expected standard or no longer improves significantly. In this way, a pre-trained prediction model that can accurately predict the number of cabin seats is obtained.
[0111] After obtaining the pre-trained prediction model, the initial expiration time corresponding to the target cache can be obtained through the pre-trained prediction model.
[0112] Specifically, Figure 4 is the flowchart of obtaining the initial expiration time in the embodiment of the present invention. As Figure 4 shown, obtaining the initial expiration time corresponding to the target cache through the pre-trained prediction model includes the following steps:
[0113] Step S421, obtain the input features corresponding to the target cache.
[0114] In this embodiment, the input features include fixed features and variable features. The fixed features include at least one of route, airline, flight number, cabin class, cabin code, and departure time. The variable features include at least one of scheduled time and time difference between scheduled time and departure time.
[0115] Among them, the scheduled time generally refers to the time point queried and reserved by the user. In the embodiment of the present invention, it refers to the current time. The time difference between scheduled time and departure time is the time difference between the scheduled time and the departure time.
[0116] Step S422: Keep the fixed features unchanged and adjust the variable features to obtain the scheduled time when the number of seats in each cabin is zero.
[0117] In this embodiment, keep the fixed features (such as route, airline, flight number, cabin class, cabin code, and departure time) unchanged, and adjust the variable features (current time and time difference between scheduled time and departure time) at a predetermined time interval to obtain a plurality of candidate input features.
[0118] Specifically, assume that the input features (route, airline, flight number, cabin class, cabin code, departure time, scheduled time, time difference between scheduled time and departure time) are denoted as (F1, F2, F3, F4, F5, F6, F7, F8). F1 - F8 respectively represent route, airline, flight number, cabin class, cabin code, departure time, scheduled time, and time difference between scheduled time and departure time. Among them, the scheduled time F7 is 01:00, and the departure time F6 is 08:00, then the time difference between scheduled time and departure time F8 is 420 min. That is, the input features can be expressed as (F1, F2, F3, F4, F5, F6, 01:00, 420).
[0119] The predetermined time interval is 1 minute. Adjust the variable features (current time and time difference between scheduled time and departure time) at the predetermined time interval to obtain the following three candidate input features in sequence:
[0120] (F1, F2, F3, F4, F5, F6, 01:01, 419);
[0121] (F1, F2, F3, F4, F5, F6, 01:02, 418);
[0122] (F1, F2, F3, F4, F5, F6, 01:03, 417);
[0123] And so on, to obtain a plurality of candidate input features.
[0124] Input each candidate input feature into a pre-trained prediction model. The pre-trained prediction model outputs the number of seats in each cabin corresponding to each candidate input feature. Thus, the scheduled time when the number of seats in each cabin is zero can be obtained.
[0125] As described above, the predicted seat quantity is the quantity for each seat. That is, assuming a flight has 50 seats, the predicted seat quantities output by the prediction model include 50 values, and the value of each is either 0 or 1. Specifically, the output layer can calculate the probability value of the existence of each seat. The value of the probability is greater than or equal to 0 and less than or equal to 1. The probability value represents the probability of the seat existing, that is, the probability of not being reserved. The closer the value is to 1, the greater the possibility that the seat is not reserved. The closer the value is to 0, the greater the possibility that the seat has been reserved. Then, the probability value is mapped to 0 or 1. For example, if the probability value is less than 0.5, it is mapped to 0; if the probability value is greater than or equal to 0.5, it is mapped to 1.
[0126] Thus, assuming a flight has 50 seats, for the 5th seat among them, the prediction model outputs the value of the 5th seat as 1 according to (F1, F2, F3, F4, F5, F6, 01:00, 420); outputs the value of the 5th seat as 1 according to (F1, F2, F3, F4, F5, F6, 01:01, 419); outputs the value of the 5th seat as 0 according to (F1, F2, F3, F4, F5, F6, 01:02, 418). Then it indicates that the reservation time when the 5th seat is 0 is 01:02. By analogy, the reservation time when each seat is 0 can be obtained.
[0127] Through the above steps, the reservation time when each seat of a flight on a route is 0 can be obtained. Adjust the flight and repeat the above steps, and the reservation times when all seats on a route are 0 can be obtained.
[0128] Among them, a route refers to a fixed flight route set by an airline between two or more locations. It defines the specific path of the aircraft from the departure airport to the destination airport, although in actual flight, it may be slightly adjusted according to air traffic control requirements or meteorological conditions. For example, the route from Beijing to Shanghai means there is a fixed flight line, and the flights on this line will shuttle between the designated airports in the two cities of Beijing and Shanghai. A flight refers to a specific flight activity that performs transportation tasks on a specific route according to a predetermined schedule. Each flight has a unique flight number for identification, and will clearly indicate information such as the departure time, arrival time, aircraft type used, and the route served.
[0129] Step S423: Determine multiple candidate expiration times according to the difference between the reservation time when each seat quantity is 0 and the current time.
[0130] In this embodiment, after obtaining the reservation time DT when each seat quantity is 0 i calculate the difference E = DT between the reservation time DT when the seat quantity is 0 i and the current time Ti -T to obtain the candidate expiration time E corresponding to each cabin i .
[0131] Step S424: Determine the minimum value among the candidate expiration times as the initial expiration time.
[0132] In this embodiment, after obtaining the candidate expiration times when all cabins in a flight route are zero, select the minimum value among them and determine it as the initial expiration time.
[0133] For example, assume the number of cabins in a certain flight route is m, then the initial expiration time E A is:
[0134] E A = min(E1, E2, E3,..., E m ).
[0135] Step S500: Determine the validity of the initial expiration time.
[0136] In this embodiment, detect whether the initial expiration time is valid. Specifically, obtain a pre-determined time interval; in response to the initial expiration time being within the time interval, determine that the initial expiration time is valid; in response to the initial expiration time not being within the time interval, determine that the initial expiration time is invalid.
[0137] Specifically, set the time interval according to the actual usage scenario. The time interval includes the minimum expiration time E min and the maximum expiration time E max . If E min ≤ E A ≤ E max , it means the initial expiration time is within the time interval, and determine that the initial expiration time is valid. If E A < E min , or E A > E max , it means the initial expiration time is not within the time interval, and determine that the initial expiration time is invalid.
[0138] Step S600: In response to the initial expiration time being valid, determine the initial expiration time as the expiration time of the target cache.
[0139] In this embodiment, if the initial expiration time is valid, it is considered that the initial expiration time is credible, and the initial expiration time is determined as the expiration time of the target cache.
[0140] Step S700: In response to the initial expiration time being invalid, obtain the expiration time of the target cache according to a predetermined algorithm rule.
[0141] In this embodiment, in response to the initial expiration time being valid, the initial expiration time is considered untrustworthy, and the expiration time of the target cache is obtained according to a predetermined algorithm rule.
[0142] Figure 5 It is a flowchart of obtaining the expiration time in an embodiment of the present invention. As Figure 5 shown, obtaining the expiration time of the target cache according to a predetermined algorithm rule includes the following steps:
[0143] Step S710: Obtain historical order data.
[0144] In this embodiment, order data within a historical predetermined time period is obtained. The historical order data includes information such as the reservation time of each class of each flight and the departure time of each flight. Among them, the reservation time of each class is the time when the class is ordered.
[0145] Step S720: Obtain reference information according to the historical order data.
[0146] In this embodiment, the reference information includes a reference parameter set and a reference expiration time. The reference parameter set includes a reference route dimension value, a reference reservation time dimension value, and a reference scheduled flight time difference dimension value.
[0147] Among them, obtaining reference information according to the historical order data includes the following steps:
[0148] Step S721: Obtain the order volume of each route within each first time period according to the historical order data, and determine the maximum value of the order volume of each route within each first time period as the reference route dimension value.
[0149] In this embodiment, the reference route dimension value is the maximum order volume within the first time period among all routes. Specifically, the first time period is divided according to a predetermined time. For example, each hour is a first time period. Each route is determined, and the flights belonging to the same route are placed in a route set. According to the reservation time of each class of each flight, the order volume of each flight within each first time period is obtained. The order volumes of the flights in the same route set within the same first time period are added up to obtain the order volume of each route within each first time period. The maximum value of the order volume within the first time period among all routes is selected and determined as the reference route dimension value.
[0150] That is to say, first divide the entire analysis period into several first time periods according to a predetermined standard (for example, one hour as a time period). Identify and classify all flight routes, and group all flights belonging to the same route together to form a route set. For each flight, use the scheduled times of its various cabins to count the order volume of each flight in each first time period. For the flights in each route set, add up their order volumes in the same first time period to obtain the total order volume of the route in that time period. Traverse all routes and find the maximum order volume as the reference route dimension value.
[0151] For example, divide the first time period by time, and divide one day (24 hours) into one first time period per hour, that is: the 1st first time period: 00:00 - 01:00; the 2nd first time period: 01:00 - 02:00;...; the 24th first time period: 23:00 - 24:00. Suppose there are five flights in the historical data, and the specific information is as follows:
[0152] Flight G1: from Beijing to Shanghai;
[0153] Flight G2: from Beijing to Guangzhou;
[0154] Flight G3: from Beijing to Shanghai;
[0155] Flight G4: from Beijing to Guangzhou;
[0156] Flight G5: from Beijing to Shanghai.
[0157] After analysis, it can be seen that the above can be divided into two flight routes:
[0158] Route H1 (from Beijing to Shanghai): including Flights G1, G3, G5;
[0159] Route H2 (from Beijing to Guangzhou): including Flights G2, G4;
[0160] Suppose the order volume of each flight in each first time period is as Figure 6 shown: Flight G1 (from Beijing to Shanghai):
[0161] 00:00 - 01:00: 5;
[0162] 01:00 - 02:00: 7;
[0163] 02:00 - 03:00: 9;
[0164] ...
[0165] 23:00 - 24:00: 6.
[0166] Flight G2 (from Beijing to Guangzhou):
[0167] 00:00 - 01:00: 3;
[0168] 01:00 - 02:00: 2;
[0169] 02:00 - 03:00: 4;
[0170] ……
[0171] 23:00 - 24:00: 5.
[0172] Flight G3 (from Beijing to Shanghai):
[0173] 00:00 - 01:00: 8;
[0174] 01:00 - 02:00: 6;
[0175] 02:00 - 03:00: 10;
[0176] ……
[0177] 23:00 - 24:00: 7.
[0178] Flight G4 (from Beijing to Guangzhou):
[0179] 00:00 - 01:00: 2;
[0180] 01:00 - 02:00: 3;
[0181] 02:00 - 03:00: 1;
[0182] ……
[0183] 23:00 - 24:00: 3.
[0184] Flight G5 (from Beijing to Shanghai):
[0185] 00:00 - 01:00: 4;
[0186] 01:00 - 02:00: 5;
[0187] 02:00 - 03:00: 6;
[0188] ……
[0189] 23:00 - 24:00: 5.
[0190] For each route, within each first time period, add up all the flight order volumes of that route to obtain the total order volume of that route in that time period.
[0191] For route H1 (from Beijing to Shanghai):
[0192] 00:00 - 01:00: 5 + 8 + 4 = 17;
[0193] 01:00 - 02:00: 7 + 6 + 5 = 18;
[0194] 02:00 - 03:00: 9 + 10 + 6 = 25;
[0195] ……
[0196] 23:00 - 24:00: 6 + 7 + 5 = 18.
[0197] Route H2 (Beijing to Guangzhou):
[0198] 00:00 - 01:00: 3 + 2 = 5;
[0199] 01:00 - 02:00: 2 + 3 = 5;
[0200] 02:00 - 03:00: 4 + 1 = 5;
[0201] ……
[0202] 23:00 - 24:00: 5 + 3 = 8.
[0203] From this, the total order volume of each route in each first time period can be obtained, and the maximum value of the total order volume is found as the reference route dimension value.
[0204] It should be noted that only part of the data for the first time period in a historical day (24 hours) is given in the above example. In actual processing, all data within the complete reservation historical time period needs to be analyzed.
[0205] Step S722: Obtain the order volume of each route in each second time period according to the historical order data, and determine the maximum value of the order volume of each route in each second time period as the reference reservation time dimension value.
[0206] In this embodiment, the reference route dimension value is the maximum order volume among all routes in the second time period. Specifically, the second time period is divided according to the predetermined time. For example, each minute is a second time period. Each route is determined, and the flights belonging to the same route are placed in a route set. According to the reservation times of each cabin of each flight, the order volume of each flight in each second time period is obtained. The order volumes of each flight in the same route set in the same second time period are added up to obtain the order volume of each route in each second time period. The maximum value of the order volumes of all routes in the second time period is selected and determined as the reference route dimension value.
[0207] For example, divide the second time period by minutes, and the division results are as follows:
[0208] The 1st second time period: 00:00 - 00:01;
[0209] The 2nd second time period: 00:01 - 00:02;
[0210] ……
[0211] The 1440th second time period: 23:59 - 24:00.
[0212] According to the historical order data, count the order volume of each flight in each second time period. Suppose there are three flights on a certain route, and the order volume data (for some time periods) are as Figure 7 shown:
[0213] Flight G6:
[0214] 00:00 - 00:01: 2;
[0215] 00:01 - 00:02: 3;
[0216] 00:02 - 00:03: 1;
[0217] ……
[0218] 23:59 - 24:00: 0.
[0219] Flight G7:
[0220] 00:00 - 00:01: 1;
[0221] 00:01 - 00:02: 2;
[0222] 00:02 - 00:03: 4;
[0223] ……
[0224] 23:59 - 24:00: 3.
[0225] Flight G8:
[0226] 00:00 - 00:01: 0;
[0227] 00:01 - 00:02: 1;
[0228] 00:02 - 00:03: 2;
[0229] ……
[0230] 23:59 - 24:00: 5.
[0231] For this route, within each second time period, add up all the flight order volumes of this route to obtain the total order volume of this route in each second time period.
[0232] 00:00 - 00:01: 2 + 1 + 0 = 3;
[0233] 00:01 - 00:02: 3 + 2 + 1 = 6;
[0234] 00:02 - 00:03: 1 + 4 + 2 = 7;
[0235] ……
[0236] 23:59 - 24:00: 0 + 3 + 5 = 8.
[0237] Thus, the order volume of a route in each second time period can be obtained. Traverse the order volumes of each route in each second time period, and find the maximum value among them as the reference reservation time dimension value. Assume that the order volume of 8 in the time period of 23:59 - 24:00 is the maximum value, then the reference reservation time dimension value is 8.
[0238] Step S723: Determine the order volume when the reservation frequency of each route is at the peak according to the reservation time of each cabin, and determine the maximum value of the order volume when the reservation frequency is at the peak as the reference flight departure time difference dimension value.
[0239] In this embodiment, the reference flight departure time difference dimension value is the order volume corresponding to the highest reservation frequency among each route, and the reservation frequency is the number of orders per unit time. Gradually increase the initial flight departure time difference according to a predetermined gradient value to obtain multiple flight departure time differences. For example, set the initial flight departure time difference to 0, with a gradient of 1 minute, and the maximum value is 7 days (10080 minutes). Gradually increase the flight departure time difference to obtain 10080 flight departure time differences from 1 minute to 10080 minutes. According to the reservation time of each cabin, determine the order volume within each flight departure time difference. Determine the reservation frequency according to the ratio of the order quantity to the flight departure time difference. Select the maximum value of the reservation frequency, and determine the order volume corresponding to the maximum reservation frequency as the reference flight departure time difference dimension value. For example, assume that the reservation frequency is the highest when the flight departure time difference is 2880 minutes, then determine the order volume within 2880 minutes of the flight departure time difference as the reference flight departure time difference dimension value.
[0240] For example, for a certain route, the latest flight departure time within a day is 24:00:
[0241] If the reservation time is 23:59, then the flight departure time difference is 1 minute, and the order volume is the order volume from 23:59 to 24:00.
[0242] If the scheduled time is 23:58, the flight departure time difference is 2 minutes, and the order volume is the order volume from 23:58 to 24:00.
[0243] If the scheduled time is 23:57, the flight departure time difference is 3 minutes, and the order volume is the order volume from 23:57 to 24:00.
[0244] As the flight departure time difference increases, the order volume will accumulate more (because the time range is wider).
[0245] Figure 8 It is a schematic diagram of the order volume of another embodiment of the present invention. Figure 8 It shows the order volume with the flight departure time difference ranging from 1 minute to 10,080 minutes. Calculate the scheduled frequency:
[0246] Flight departure time difference is 1 minute: 5÷1 = 5.
[0247] Flight departure time difference is 2 minutes: 12÷2 = 6.
[0248] Flight departure time difference is 3 minutes: 20÷3≈6.67.
[0249] Flight departure time difference is 4 minutes: 25÷4 = 6.25.
[0250] Flight departure time difference is 5 minutes: 30÷5 = 6.
[0251] Flight departure time difference is 10,080 minutes: 30÷5 = 5.6.
[0252] Find the maximum value of the scheduled frequency. If the maximum scheduled frequency is 6.67, it appears when the flight departure time difference is 3 minutes. Determine the reference flight departure time difference dimension value, and the corresponding order volume is 20. Therefore, the reference flight departure time difference dimension value is 20.
[0253] At the same time, set the reference expiration time to the minimum expiration time E min .
[0254] Step S730: Determine at least one target parameter set corresponding to the target cache.
[0255] In this embodiment, the target parameter set includes a target route dimension value, a target scheduled time dimension value, and a target flight departure time difference dimension value.
[0256] Specifically, obtaining the target parameter set includes the following steps:
[0257] Step S731: Obtain the query information corresponding to the target cache.
[0258] In this embodiment, the business server obtains the query information corresponding to the target cache, such as information on the departure place, destination, departure time, and query time.
[0259] Step S732: Determine the target route, target scheduled time, and target flight departure time difference according to the query information.
[0260] In this embodiment, the target route is determined according to the departure location and destination, and the current time is determined as the target scheduled time. The latest departure time is obtained according to the departure time, and the difference between the latest departure time and the current time is determined as the target flight departure time difference.
[0261] For example, assume the query information is as follows:
[0262] Departure location: Beijing;
[0263] Destination: Shanghai;
[0264] Departure time: April 8, 2025;
[0265] Query time: April 6, 2025, 12:00;
[0266] Then, the target route is "Beijing to Shanghai".
[0267] The target scheduled time is: April 6, 2025, 12:00.
[0268] Determination of the target flight departure time difference: Calculate the time difference from the current time to the latest departure time of the flight. Assume the latest departure time is April 8, 2025, 24:00, then the target flight departure time difference is: (April 8, 2025, 24:00) - (April 6, 2025, 12:00) = 60 hours.
[0269] Step S733: Determine the target route dimension value according to the target route and the target scheduled time.
[0270] In this embodiment, the target route dimension value is the average order volume within the first time period in which the target scheduled time is located in the target route. Specifically, obtain the historical order data corresponding to the target route, divide the first time period according to the scheduled time. For example, each hour is a first time period. Obtain the first time period in which the current time is located as the target first time period, and obtain the target route dimension value according to the historical order data of the target route within the target first time period.
[0271] For example, if the current time (target scheduled time) is April 6, 2025, 12:00, then determine the first time period in which it is located as 12:00 - 13:00, obtain the order volume between 12:00 - 13:00 for each day within the historical time period of the target route, and average the order volumes between 12:00 - 13:00 for each day to obtain the target route dimension value.
[0272] Assume that the historical time period is seven days, and the order quantities between 12:00 and 13:00 in the past seven days are 5, 8, 6, 9, 4, 3, and 7 respectively. Then the target route dimension value is (5 + 8 + 6 + 9 + 4 + 3 + 7) ÷ 7 = 6.
[0273] Step S734: Determine the target scheduled time dimension value according to the target route and the target scheduled time.
[0274] In this embodiment, the target scheduled time dimension value is the average order quantity within the second time period where the target scheduled time is located in the target route. Specifically, obtain the historical order data corresponding to the target route, divide the second time period according to the scheduled time. For example, each minute is a second time period. Obtain the second time period where the current time is located as the target second time period, and obtain the target scheduled time dimension value according to the historical order data of the target route within the target second time period.
[0275] For example, if the current time (target scheduled time) is 12:00 on April 6, 2025, then determine that the second time period it is located in is 12:00 - 12:01. Obtain the order quantities between 12:00 and 12:01 on each day within the historical time period of the target route, and calculate the average of the order quantities between 12:00 and 12:01 on each day to obtain the target scheduled time dimension value.
[0276] Assume that the historical time period is seven days, and the order quantities between 12:00 and 12:01 in the past seven days are 1, 2, 0, 2, 1, 3, and 2 respectively. Then the target scheduled time dimension value is (1 + 2 + 0 + 2 + 1 + 3 + 2) ÷ 7 ≈ 1.6.
[0277] Step S735: Determine the target flight departure time difference dimension value according to the target route and the target scheduled time.
[0278] In this embodiment, the target flight departure time difference dimension value is the average order quantity of the target route within the target flight departure time difference dimension value. Obtain the order quantities of the target route within the target flight departure time difference on each day within the historical time period, and calculate the average of the order quantities within the target flight departure time difference on each day to obtain the target flight departure time difference dimension value.
[0279] For example, the target scheduled time is 12:00 on April 6, 2025, and the latest departure time is 24:00 on April 8, 2025. Then the target flight departure time difference is: (24:00 on April 8, 2025) - (12:00 on April 6, 2025) = 60 hours. Then obtain the order quantities from the latest departure time to 60 hours before on each day within the historical time period, and then calculate the average order quantity to obtain the target flight departure time difference dimension value.
[0280] Thus, a set of target parameters with the current moment as the target scheduled moment can be obtained.
[0281] In some embodiments, a set of target parameters corresponding to at least one consecutive moment after the current moment can also be obtained. Taking the example of obtaining a set of target parameters corresponding to two consecutive moments after the current moment for illustration.
[0282] First, taking the current moment as the target scheduled moment, through the above steps S731 - S735, a set of parameters at the current moment can be obtained. The set of parameters includes a target route dimension value, a target scheduled moment dimension value, and a target flight time difference dimension value. For example, assuming the current moment is 12:00 on April 6, 2025, the target scheduled moment is: 12:00 on April 6, 2025.
[0283] Then, taking a moment after the current moment as the target scheduled moment, through the above steps S731 - S735, a set of parameters at a moment after the current moment can be obtained. The set of parameters includes a target route dimension value, a target scheduled moment dimension value, and a target flight time difference dimension value. For example, assuming the current moment is 12:00 on April 6, 2025, the target scheduled moment is: 12:01 on April 6, 2025.
[0284] Finally, taking the second moment after the current moment as the target scheduled moment, through the above steps S731 - S735, a set of parameters with the second moment after the current moment as the target scheduled moment can be obtained. The set of parameters includes a target route dimension value, a target scheduled moment dimension value, and a target flight time difference dimension value. For example, assuming the current moment is 12:00 on April 6, 2025, the target scheduled moment is: 12:02 on April 6, 2025.
[0285] Step S740: Determine the expiration time of the target cache according to the reference parameter set, the reference expiration time, and the target parameter set.
[0286] Specifically, Figure 9 is a flowchart of determining the expiration time of the target cache in an embodiment of the present invention. As Figure 9 shown, determining the expiration time of the target cache according to the reference parameter set, the reference expiration time, and the target parameter set includes the following steps:
[0287] Step S741: Determine the ratio of each parameter in the reference parameter set to the corresponding parameter in the target parameter set.
[0288] In this embodiment, as described above, reference information can be obtained based on historical order data, the reference information includes a reference parameter set and a reference expiration time, and the reference parameter set includes a reference route dimension value, a reference reservation time dimension value, and a reference scheduled flight time difference dimension value. In this embodiment of the present invention, the reference route dimension value, the reference reservation time dimension value, and the reference scheduled flight time difference dimension value are respectively denoted as 0 AL_M , O DT_M and O SD_M At the same time, a target parameter set corresponding to the target cache can be obtained, that is, a target parameter set with the current time as the target scheduled time. The target parameter set includes a target route dimension value, a target scheduled time dimension value, and a target scheduled flight time difference dimension value. In the embodiment of the present invention, the target route dimension value, the target scheduled time dimension value, and the target scheduled flight time difference dimension value are respectively denoted as 0 AL_Q , O DT_Q and O SD_Q .
[0289] Then, the ratio of each parameter in the reference parameter set to the corresponding parameter in the target parameter set is determined: AL_M / O AL_Q , O DT_M / O DT_Q , O SD_M / O SD_Q .
[0290] Step S742: Perform a weighted summation on the ratios of the various parameters to obtain the order quantity ratio corresponding to the target parameter set.
[0291] In this embodiment, a predetermined weight value is obtained, and the weight value includes a first weight value α, a second weight value β, and a third weight value γ, wherein α+β+γ=1. For example, α=0.2, β=0.3, γ=0.5.
[0292] The ratios of the parameters are weighted and summed according to the predetermined weight values to obtain the order quantity ratio corresponding to the target parameter set. The specific calculation formula is as follows:
[0293]
[0294] Among them, R is the order quantity ratio, α, β, γ are the predetermined weight values, O AL_Q , O DT_Q and O SD_Q are the target route dimension value, the target scheduled time dimension value and the target scheduled flight time difference dimension value, AL_M , O DT_M and O SD_M It is the reference route dimension value, the reference scheduled time dimension value and the reference scheduled flight time difference dimension value.
[0295] Step S743: Determine the expiration time of the target cache according to the product of the order quantity ratio and the reference expiration time.
[0296] In this embodiment, the product of the order quantity ratio and the reference expiration time is used as the expiration time of the target cache. Specifically, the calculation formula for the expiration time is as follows:
[0297] E = R * E min
[0298] where E is the expiration time, R is the order quantity ratio, and E min is the reference expiration time.
[0299] Thus, the expiration time of the target cache can be obtained according to the target parameter set with the current moment as the target predetermined moment.
[0300] For example, assume that the reference route dimension value O AL_M obtained from historical order data is 5000, the reference predetermined moment dimension value O DT_M is 300, and the reference flight departure time difference dimension value is 2000. The current query information is: the route is from Beijing to Shanghai, the current moment is 10:45, and the flight departure time difference is 2900 minutes. α = 0.2, β = 0.3, γ = 0.5. At the same time, the target route dimension value O AL_Q obtained according to the current query information is 800, the target predetermined moment dimension value O DT_Q is 50, and the target flight departure time difference dimension value O SD_Q is 150.
[0301] Then the value of the order quantity ratio R is:
[0302]
[0303] Assume that the reference expiration time E min is 60 seconds, then the expiration time E of the target cache is:
[0304] E = R * E min = 9.72 * 60 ≈ 583
[0305] Thus, the target expiration time can be set to 583 seconds.
[0306] In some embodiments, the target parameter set may further include the current moment and the parameter sets corresponding to at least one consecutive moment after the current moment.
[0307] Specifically, Figure 10 is the flowchart of another embodiment of the present invention for determining the expiration time of the target cache. As Figure 10As shown, determining the expiration time of the target cache according to the reference parameter set, the reference expiration time, and the target parameter set includes the following steps:
[0308] Step S744: Determine the ratio of each parameter in the reference parameter set to the corresponding parameter in the target parameter set.
[0309] In this embodiment, the target parameter set includes the parameter sets corresponding to the current moment and at least one consecutive moment after the current moment. In the embodiment of the present invention, two consecutive moments after the current moment are taken as an example for illustration. Denote the parameter set at the current moment as O AL_Q_K 、O DT_Q_K and O SD_Q_K , denote the parameter set at the first moment after the current moment as O AL_Q_K+1 、O DT_Q_K+1 and O SD_Q_K+1 , denote the parameter set at the second moment after the current moment as O AL_Q_K+2 、O DT_Q_K+2 and O SD_Q_K+2 . Denote the reference route dimension value, the reference scheduled moment dimension value, and the reference fixed flight time difference dimension value as O AL_M 、O DT_M and O SD_M .
[0310] Then, determine the ratio of each parameter in the reference parameter set to the corresponding parameter in the target parameter set.
[0311] Among them, the ratio of each parameter in the reference parameter set to the parameter set at the current moment is: O AL_M / O AL_Q_K 、O DT_M / O DT_Q_K 、O SD_M / O SD_Q_K .
[0312] The ratio of each parameter in the reference parameter set to the parameter set at the first moment after the current moment is: O AL_M / O AL_Q_K+1 、O DT_M / O DT_Q_K+1 、O SD_M / O SD_Q_K+1 .
[0313] The ratio of each parameter in the reference parameter set to the parameter set at the second moment after the current moment is: O AL_M / O AL_Q_K+2 、O DT_M / O DT_Q_K+2 、O SD_M / O SD_Q_K+2 .
[0314] Step S745: Perform weighted summation on the ratios of each parameter to obtain the order quantity ratio corresponding to the target parameter set.
[0315] In this embodiment, obtain the pre-determined weight values, where the weight values include a first weight value α, a second weight value β, and a third weight value γ, and α + β + γ = 1. For example, α = 0.2, β = 0.3, and γ = 0.5. Perform weighted summation on the ratios of each parameter to obtain the order quantity ratio corresponding to the target parameter set.
[0316] For the ratios of each parameter between the reference parameter set and the parameter set at the current moment, the weighted summation formula is:
[0317]
[0318] For the ratios of each parameter between the reference parameter set and the first moment after the current moment, the weighted summation formula is:
[0319]
[0320] For the ratios of each parameter between the reference parameter set and the second moment after the current moment, the weighted summation formula is:
[0321]
[0322] Step S746: Obtain the average value of the order quantity ratios of multiple target parameter sets.
[0323] Among them, the average value of the order quantity ratio is:
[0324] R = (R K + R K+1 + R K+2 ) / 3
[0325] Among them, R is the average value of the order quantity ratio, R K is the ratio of each parameter between the reference parameter set and the parameter set at the current moment, R K+1 is the ratio of each parameter between the reference parameter set and the parameter set at the first moment after the current moment, R K+2 is the ratio of each parameter between the reference parameter set and the parameter set at the second moment after the current moment.
[0326] Step S747: Determine the expiration time of the target cache according to the product of the average value of the order quantity ratio and the reference expiration time.
[0327] In this embodiment, use the product of the order quantity ratio and the reference expiration time as the expiration time of the target cache. Specifically, the calculation formula for the expiration time is as follows:
[0328] E = R * E min
[0329] Wherein, E is the expiration time, R is the order quantity ratio, and E min is the reference expiration time.
[0330] Thus, the expiration time of the target cache can be obtained according to the set of target parameters with the current moment and at least one consecutive moment after the current moment as the target scheduled moments.
[0331] For example, assume that the reference route dimension value O AL_M obtained from historical order data is 5000, the reference scheduled moment dimension value O DT_M is 300, and the reference flight time difference dimension value is 2000. The current query information is: the route is from Beijing to Shanghai, the current moment is 10:45, and the flight time difference is 2900 minutes. α = 0.2, β = 0.3, γ = 0.5.
[0332] Each parameter of the parameter set at the current moment obtained according to the current query information includes: the target route dimension value O AL_Q is 800, the target scheduled moment dimension value O DT_Q is 50, and the target flight time difference dimension value O SD_Q is 150.
[0333] Then the order quantity ratio R K value is:
[0334]
[0335] Each parameter of the parameter set at the first moment after the current moment obtained according to the current query information includes: the target route dimension value O AL_Q is 600, the target scheduled moment dimension value O DT_Q is 40, and the target flight time difference dimension value O SD_Q is 140.
[0336] Then the order quantity ratio R K+1 value is:
[0337]
[0338] Each parameter of the parameter set at the second moment after the current moment obtained according to the current query information includes: the target route dimension value O AL_Q is 1000, the target scheduled moment dimension value O DT_Q is 80, and the target flight time difference dimension value O SD_Q is 200.
[0339] Then the order quantity ratio is R K+2 The value of is:
[0340]
[0341] The average value of the order quantity ratio is:
[0342] R = (R K + R K+1 + R K+2 ) / 3 = 9.36
[0343] Assume the reference expiration time E min is 60 seconds, then the expiration time E of the target cache is:
[0344] E = R * E min = 9.36 * 60 ≈ 562
[0345] Therefore, the target expiration time can be set to 562 seconds.
[0346] The change frequency of the air ticket price is positively correlated with the booking frequency. The more frequent the booking, the higher the change frequency of the price. Usually, the airline will pre-configure the prices of each discount and the corresponding seat numbers. When the booking times of a certain price exceed the set seat number, this price will disappear, that is, the price changes or the offer becomes invalid. Considering the above characteristics, the cache expiration time setting strategy of the present invention is mainly formulated around the booking frequency and the seat number. Therefore, through parameters such as route / booking time / departure time difference, the expiration time of the cache is set flexibly.
[0347] In some embodiments, for the product of the order quantity ratio and the reference expiration time in step S743 above, and the product of the average value of the order quantity ratio and the reference expiration time in S747, it may occur that the calculated product is less than the minimum expiration time E min or greater than the maximum expiration time E max of the case. Since the expiration time must be between the minimum expiration time E min and the maximum expiration time E max . Therefore, in response to the product of the average value of the order quantity ratio and the reference expiration time being within the time interval, the product of the average value of the order quantity ratio and the reference expiration time is used as the expiration time of the target cache; in response to the product of the average value of the order quantity ratio and the reference expiration time being greater than the maximum value of the time interval, the maximum value of the time interval is used as the expiration time of the target cache; in response to the product of the average value of the order quantity ratio and the reference expiration time being less than the minimum value of the time interval, the minimum value of the time interval is used as the expiration time of the target cache.
[0348] In some embodiments, the method further includes:
[0349] In response to the target cache reaching the expiration time, invalidating the target cache.
[0350] Wherein, invalidating the target cache may be deleting the cache entry corresponding to the target cache in the cache container, or marking it as invalid.
[0351] In the embodiments of the present invention, by obtaining an update event, determining query information corresponding to the update event, obtaining a query result according to the query information, and storing it in a target cache, obtaining an initial expiration time corresponding to the target cache through a pre-trained prediction model, determining the validity of the initial expiration time, in response to the initial expiration time being valid, determining the initial expiration time as the expiration time of the target cache, and in response to the initial expiration time being invalid, obtaining the expiration time of the target cache according to a predetermined algorithm rule. Thereby, the accuracy of the ticket price quote cache can be improved and the operation cost can be reduced.
[0352] Figure 11 is a schematic diagram of the ticket processing device according to the embodiments of the present invention. As Figure 11 shown, the ticket processing device according to the embodiments of the present invention includes an event acquisition unit 111, a query information acquisition unit 112, a cache acquisition unit 113, an initial expiration time acquisition unit 114, a validity determination unit 115, a first time determination unit 116, and a second time determination unit 117. Among them, the event acquisition unit 111 is used to acquire an update event. The query information acquisition unit 112 is used to determine the query information corresponding to the update event, and the query information includes at least one of a departure place, a destination, a departure time, and a query time. The cache acquisition unit 113 is used to obtain a query result according to the query information and store it in a target cache. The initial expiration time acquisition unit 114 is used to obtain an initial expiration time corresponding to the target cache through a pre-trained prediction model. The validity determination unit 115 is used to determine the validity of the initial expiration time. The first time determination unit 116 is used to, in response to the initial expiration time being valid, determine the initial expiration time as the expiration time of the target cache. The second time determination unit 117 is used to, in response to the initial expiration time being invalid, obtain the expiration time of the target cache according to a predetermined algorithm rule.
[0353] In an embodiment of the present invention, by obtaining an update event, determining query information corresponding to the update event, obtaining a query result according to the query information, and storing it in a target cache, an initial expiration time corresponding to the target cache is obtained through a pre-trained prediction model, the validity of the initial expiration time is determined, in response to the initial expiration time being valid, the initial expiration time is determined as the expiration time of the target cache, and in response to the initial expiration time being invalid, the expiration time of the target cache is obtained according to a predetermined algorithm rule. Thereby, the accuracy of the ticket price quotation cache can be improved and the operation cost can be reduced.
[0354] Figure 12 is a schematic diagram of an electronic device according to an embodiment of the present invention. As Figure 12 shown, Figure 12 the electronic device shown is a general-purpose data processing device, which includes a general computer hardware structure, and at least includes a processor 121 and a memory 122. The processor 121 and the memory 122 are connected through a bus 123. The memory 122 is suitable for storing instructions or programs executable by the processor 121. The processor 121 can be an independent microprocessor or a set of one or more microprocessors. Thus, the processor 121 processes data and controls other devices by executing the instructions stored in the memory 122 to implement the method flow of the embodiment of the present invention as described above. The bus 123 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to a display controller 124, a display device, and an input / output (I / O) device 125. The input / output (I / O) device 125 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a body sensing input device, a printer, and other devices well-known in the art. Typically, the input / output (I / O) device 125 is connected to the system through an input / output (I / O) controller 126.
[0355] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device (equipment), or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0356] The present application is described with reference to the flowcharts of methods, devices (equipment), and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions.
[0357] These computer program instructions can be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the function specified in one process Figure 1 or functions in a process or multiple processes.
[0358] These computer program instructions can also 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, such 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 Figure 1 or functions in a process or multiple processes.
[0359] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, which is used for a computer to execute some or all of the above method embodiments.
[0360] That is, those skilled in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by specifying relevant hardware through a program. The program is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0361] The foregoing are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A ticket processing method, characterized in that, The method includes: Obtaining an update event; Determining query information corresponding to the update event, where the query information includes at least one of a departure location, a destination, and a departure time; Obtaining a query result according to the query information and storing it in a target cache; Obtaining an initial expiration time corresponding to the target cache through a pre-trained prediction model; Determining the validity of the initial expiration time; In response to the initial expiration time being valid, determining the initial expiration time as the expiration time of the target cache; In response to the initial expiration time being invalid, obtaining the expiration time of the target cache according to a predetermined algorithm rule.
2. The method according to claim 1, wherein The obtaining of the update event includes: Receiving a query request from a user; In response to there being no valid cache corresponding to the query request, generating an update event.
3. The method according to claim 1, wherein The obtaining of the update event includes: In response to detecting cache invalidation, generating an update event.
4. The method according to claim 1, wherein The query result includes ticket quotes.
5. The method according to claim 1, characterized in that, The obtaining of the initial expiration time corresponding to the target cache through a pre-trained prediction model includes: Obtaining input features corresponding to the target cache, where the input features include fixed features and variable features, the fixed features include at least one of a flight route, an airline, a flight number, a class of service, a cabin code, and a departure time, and the variable features include at least one of a scheduled time and a difference between the scheduled time and the actual departure time; Keeping the fixed features unchanged and adjusting the variable features to obtain the scheduled time when the number of seats in each class is zero; Determining multiple candidate expiration times according to the difference between the scheduled time when the number of seats in each class is zero and the current time; Determining the minimum value among the candidate expiration times as the initial expiration time.
6. The method according to claim 1, wherein The determining of the validity of the initial expiration time includes: Obtaining a pre-determined time interval; In response to the initial expiration time being within the time interval, determining the initial expiration time as valid; In response to the initial expiration time not being within the time interval, determining the initial expiration time as invalid.
7. The method according to claim 6, characterized in that, The obtaining of the expiration time of the target cache according to a predetermined algorithm rule includes: Obtaining historical order data; Obtaining reference information according to the historical order data, where the reference information includes a set of reference parameters and a reference expiration time, and the set of reference parameters includes a reference flight route dimension value, a reference scheduled time dimension value, and a reference difference between the scheduled time and the actual departure time dimension value; Determining at least one set of target parameters corresponding to the target cache; Determining the expiration time of the target cache according to the set of reference parameters, the reference expiration time, and the set of target parameters.
8. The method according to claim 7, wherein The set of target parameters is the parameter set corresponding to the current time and at least one consecutive time after the current time.
9. The method according to claim 8, wherein The determining of the expiration time of the target cache according to the set of reference parameters, the reference expiration time, and the set of target parameters includes: Determining the ratio of each parameter in the set of reference parameters to the corresponding parameter in the set of target parameters; Performing weighted summation on the ratios of each parameter to obtain the order quantity ratio corresponding to the set of target parameters; Obtaining the average value of the order quantity ratios of multiple sets of target parameters; Determine the expiration time of the target cache according to the product of the average value of the order quantity ratio and the reference expiration time.
10. The method according to claim 9, wherein The determining the expiration time of the target cache according to the product of the average value of the order quantity ratio and the reference expiration time includes: In response to the product of the average value of the order quantity ratio and the reference expiration time being within the time interval, use the product of the average value of the order quantity ratio and the reference expiration time as the expiration time of the target cache; In response to the product of the average value of the order quantity ratio and the reference expiration time being greater than the maximum value of the time interval, use the maximum value of the time interval as the expiration time of the target cache; In response to the product of the average value of the order quantity ratio and the reference expiration time being less than the minimum value of the time interval, use the minimum value of the time interval as the expiration time of the target cache.
11. The method according to claim 1, characterized in that The method further includes: In response to the target cache reaching the expiration time, invalidate the target cache.
12. A ticket processing device, characterized in that, The device includes: An event acquisition unit, configured to acquire update events; A query information acquisition unit, configured to determine the query information corresponding to the update event, where the query information includes at least one of a departure place, a destination, a departure time, and a query time; A cache acquisition unit, configured to acquire a query result according to the query information and store it in the target cache; An initial expiration time acquisition unit, configured to acquire the initial expiration time corresponding to the target cache through a pre-trained prediction model; A validity determination unit, configured to determine the validity of the initial expiration time; A first time determination unit, configured to, in response to the initial expiration time being valid, determine the initial expiration time as the expiration time of the target cache; A second time determination unit, configured to, in response to the initial expiration time being invalid, acquire the expiration time of the target cache according to a predetermined algorithm rule.
13. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1-11.
14. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program runs on a computer, the computer executes the method according to any one of claims 1-11 above.
15. A computer-readable storage medium storing computer program instructions thereon, characterized in that, The computer program instructions, when executed by a processor, implement the method according to any one of claims 1-11.
Citation Information
Patent Citations
Method and device for determining caching time of data from server
CN107948230A
Data processing method and device and storage medium
CN112734064A
Travel product query method and device, travel product model training method and device, equipment and storage medium
CN114840559A
Method and device for determining caching strategy
WO2018023966A1