Cache data processing method and system, storage medium and electronic equipment
By checking the effectiveness of search result cache in the flight information query system, the problem of search result cache not being updated in time is solved, reducing the system burden, and improving system performance and user experience.
Patent Information
- Application Number
- CN202411523772.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, the search results of the flight information query system are cached and not updated in time during the validity period, resulting in the failure of the cabin inspection and price verification when purchasing tickets, and the ticket purchase experience is poor. At the same time, frequent polling and refreshing to improve cache accuracy will cause excessive burden on the system and affect performance.
A cached data processing method is proposed to verify the validity of search result cache, obtain invalid search results, and process them based on dimensions such as the proportion of failed search results and the changes in the richness of airlines, so as to reduce the consumption of active polling requests , extend the validity period of the cache.
It reduces performance losses caused by frequent refreshes, ensures that the data obtained by users is relatively accurate, reduces the computing pressure of the back-end system, and improves the performance and stability of the overall system.
Smart Images

Figure CN119396885A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to a cache data processing method, system, storage medium and electronic device. Background Art
[0002] The fare search system is a flight information query system provided for users. The search results of the fare search system include flight space availability, fares, additional services and other information, realizing real-time display of products that can be sold through all channels.
[0003] Users search based on departure place, destination, date and other personal search preferences, and the search results obtained will be stored in the cache module. The cache module sets different cache validity periods based on the departure place, destination and date requested by the user through rule setting, machine learning and other methods.
[0004] When the user subsequently searches based on the departure place, destination, date and other personal search preferences, the freight rate search system first searches the cache module to see if there is a matching search result cache within the validity period. If so, the cache is directly returned to the user. If not, the search engine is called to perform a real-time query based on this search condition.
[0005] This solution has the following problems: although the search result cache is within the validity period, the search result cache is not updated in a timely manner after changes in flight cabin status, freight rates, additional service fees and other information occur. As a result, when users purchase tickets based on the above search result cache, cabin and price verification fails, resulting in a poor ticket purchasing experience.
[0006] If frequent polling and refreshing are performed to improve cache accuracy in order to solve the above problems, the system will be overloaded, performance will be affected, and cache efficiency will be reduced. Therefore, it is necessary to balance the two and adopt reasonable strategies to ensure the timeliness and accuracy of cache data, while avoiding excessive refreshes, reducing the consumption of system resources, and improving system stability and reliability. Summary of the invention
[0007] In view of the above problems, the present invention proposes a cache data processing method, system, storage medium and electronic device.
[0008] A cache data processing method of the present invention specifically includes:
[0009] Obtain search result cache based on user request;
[0010] Verifying the validity of search results in the search result cache and obtaining invalid search results;
[0011] The search result cache is processed based on the invalid search result.
[0012] Further,
[0013] The verifying the validity of the search results in the search result cache includes:
[0014] There are three verification dimensions: accuracy verification of available space, correctness verification of exchange rates, and validity verification of freight rates.
[0015] Further,
[0016] The processing of the search result cache based on the invalid search results includes:
[0017] The judgment is made based on five dimensions: the proportion of invalid search results, the proportion of invalid search results in direct flights, the changes in the richness of airlines, the proportion of invalid search results in low-cost routes, and the richness of connecting flights.
[0018] Further,
[0019] The processing of the search result cache includes:
[0020] There are two processing methods: invalidation of the entire search result cache and deletion of invalid search results in the search result information cache.
[0021] Further,
[0022] After deleting the invalid search results in the search result cache, the method further includes:
[0023] Shorten the search result cache validity period.
[0024] Further,
[0025] After the search result cache is completely invalidated and the validity period of the search result cache is shortened, the method further includes:
[0026] The processing result of the overall invalidation of the search result cache and the shortening of the validity period of the search result cache is notified to the active polling module.
[0027] The present invention also provides a cache data processing system for implementing the above cache data processing method, the system comprising:
[0028] A search engine, used to search according to the departure place, destination, date and other personal search preferences entered by the user at the front end as search conditions, obtain search results, and write the search results into a cache module;
[0029] A cache module, used for storing the search results written by the search engine to form a search result cache;
[0030] A cache verification module, used to verify the validity of the search results in the search result cache, obtain invalid search results, process the search result cache based on the invalid search results, and notify the active polling module of the processing results;
[0031] The cabin status query module is used to query the cabin availability status and number of available seats of the flight;
[0032] The active polling module is used to receive the processing result of the cache verification module on the search result cache, actively call the search engine to obtain the latest search result based on the processing result, and write the latest search result into the cache module.
[0033] Further,
[0034] The search engine is also used to receive the exchange rate change increment data and the freight rate increment data, and push the exchange rate change increment data and the freight rate increment data to the cache verification module.
[0035] The present invention also provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the aforementioned cache data processing method.
[0036] The present invention also provides an electronic device, comprising a processor coupled to a memory; the processor is used to read and execute a computer program stored in the memory to implement the aforementioned cache data processing method.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] The cache data processing method and system proposed in the present invention allow that when a search result in the cache becomes invalid, the entire cache will not be invalidated. Instead, the cache and the data in the cache are processed according to different situations, thereby reducing the consumption of active polling requests, extending the validity period of the cache to the maximum extent, reducing performance loss caused by frequent refreshes, and ensuring that the data obtained by the user is relatively accurate.
[0039] At the same time, by making rational use of the freight rate change log, the computing pressure of the backend system can be reduced and the performance and stability of the overall system can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 It is a structural schematic diagram of the cache data processing system of the present invention;
[0042] Figure 2 It is a flow chart of the cache data processing method of the present invention;
[0043] Figure 3 It is a schematic structural diagram of the electronic device of the present invention.
[0044] Description of reference numerals:
[0045] 101 - search engine, 102 - cache module, 103 - cache verification module, 104 - cabin status query module, 105 - active polling module, 301 - processor, 302 - memory. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Figure 1 It is a structural diagram of a cache data processing system provided by an embodiment of the present invention, including a search engine, a cache module, a cache verification module, a cabin status query module and an active polling module.
[0048] 1. Search Engine 101
[0049] It is used to search according to the departure place, destination, date and other personal search preferences entered by the user on the front end, obtain search results, and write the search results into the cache module. The search results include flight details, class space, freight rates, additional service fees and other route-related information.
[0050] It is also used to receive the incremental data of exchange rate changes and the incremental data of freight rates, and push the incremental data of exchange rate changes and the incremental data of freight rates to the cache verification module.
[0051] 2. Cache module 102
[0052] Used to store search results written by search engines to form a search result cache.
[0053] 3. Cache verification module 103
[0054] It is used to verify the validity of search results in the search result cache, obtain invalid search results, process the search result cache based on the invalid search results, and notify the active polling module of the processing results.
[0055] 4. Cabin status query module 104
[0056] Used to query the flight class availability and available seats. The class availability status is also called "AV".
[0057] 5. Active polling module 105
[0058] It is used to receive the processing result of the cache verification module on the search result cache, actively call the search engine to obtain the latest search results based on the processing result, and write the latest search results into the cache module.
[0059] Based on the above cache data processing system, the embodiment of the present invention also provides a cache data processing method, such as Figure 2 As shown, the following steps are included.
[0060] It is worth noting that the following steps are generated for a user's request. When each user makes a request, it will be processed according to the following steps.
[0061] S201: Obtain search result cache according to user request.
[0062] The user searches on the front end using the departure place, destination, date and other personal search preferences as search conditions to obtain search results. After receiving the search request, the cache data processing system determines whether there is a search result cache matching the search conditions in the cache module. If not, the search engine is called to search to obtain the search results. The search engine stores the search results in the cache module to generate a search result cache and returns the search results to the user. If so, step S202 is executed.
[0063] S202: Verify the validity of the search results in the search result cache, and obtain invalid search results.
[0064] Based on the search result cache obtained in step S201, all search results therein are traversed to determine whether the search results are invalid from the following three dimensions.
[0065] For ease of reading, in the description of step S202, "search result cache" is uniformly referred to as "cache".
[0066] Dimension 1: Accuracy verification of space availability status.
[0067] The specific steps are as follows:
[0068] Step 1: Record the available space status corresponding to the current freight rate in the cache.
[0069] Step 2: Query the available space status from the space status query module.
[0070] Step 3: Compare the available space status in the cache with the available space status obtained from the space status query module to see if they are consistent. If they are consistent, it is considered that the available space status has not changed and the search result is not invalid. If they are inconsistent, it is considered that the available space status has changed and the search result is invalid.
[0071] Dimension 2: Verification of the correctness of the exchange rate.
[0072] The specific steps are as follows:
[0073] Step 1: After receiving the incremental data of exchange rate changes, the search engine pushes the data to the cache verification module.
[0074] Step 2: Check whether the exchange rate corresponding to the currency in the cache is consistent with the changed exchange rate. If they are consistent, the search result will not be invalid. If they are inconsistent, the search result will be invalid.
[0075] Dimension three: Verification of freight rate validity.
[0076] The specific steps are as follows:
[0077] Step 1: After receiving the freight rate increment data, the search engine updates the freight rate change log and pushes the data to the cache verification module.
[0078] Step 2: Compare the carrier airlines and fare table in the cache with the fares in the fare change log. If the carrier airlines and fare table in the cache do not use the fares in the fare change log, it is considered that the fare of the search result has not changed and the search result is not invalid. If the carrier airlines and fare table in the cache use the fares in the fare change log, it is considered that the fare of the search result has changed and the search result is invalid.
[0079] The above describes a method for verifying the validity of search results in the cache from three dimensions. The invalid search results obtained by the above method are necessary data for executing step S203.
[0080] S203: Processing the search result cache based on the invalid search results.
[0081] Based on the invalid search results, the cache verification module determines how to handle the search result cache from the following five dimensions: the proportion of invalid search results, the proportion of invalid search results in direct flights, the changes in the richness of airlines, the proportion of invalid search results in low-cost routes, and the richness of connecting flights.
[0082] There are two ways to deal with this: invalidate the entire search result cache, and delete the invalid search results in the search result cache and shorten the validity period of the search result cache. Deleting the invalid search results in the search result cache is equivalent to editing the search result cache.
[0083] After the overall invalidation of the search result cache and the shortening of the validity period of the search result cache, the active polling module needs to be notified by means of a message notification.
[0084] Similarly, for ease of reading, in the description of step S203, "search result cache" is uniformly referred to as "cache".
[0085] Dimension 1: The proportion of invalid search results.
[0086] The cache invalidation threshold is determined based on the number of all search results in the cache, and it is determined whether the number of invalid search results exceeds the cache invalidation threshold. If so, the entire cache is invalidated. If not, only the invalid search results are removed from the cache.
[0087] For example,
[0088] When the number of all search results in the cache is greater than 50, the cache invalidation threshold is set to 20%; when the number of all search results in the search result cache is less than or equal to 50, the cache invalidation threshold is set to 10%.
[0089] When the number of all search results is 60, it should be calculated according to the 20% threshold. When the number of invalid search results exceeds 60*20%, the entire cache is invalid. When the number of all search results is 40, it should be calculated according to the 10% threshold. When the number of invalid search results exceeds 40*10%, the entire cache is invalid.
[0090] Dimension 2: The proportion of invalid search results for direct flights.
[0091] The cache invalidation threshold is determined according to the proportion of direct flights in the cache, and it is determined whether the number of invalid search results in the direct flights exceeds the cache invalidation threshold. If it exceeds, the entire cache is invalidated. If it does not exceed, only the invalid search results are removed from the cache.
[0092] For example,
[0093] When the proportion of direct flights in the cache is greater than 20%, the cache invalidation threshold is 10%; when the proportion is less than or equal to 20%, the cache invalidation threshold is 5%.
[0094] Then, when the number of all search results is 100: the number of direct flights is 30, which accounts for more than 20%, and should be calculated according to the 10% threshold. When the number of invalid search results exceeds 30*10%, the entire cache is invalid; the number of direct flights is 20, which accounts for less than or equal to 20%, and should be calculated according to the 5% threshold. When the number of invalid search results exceeds 20*5%, the entire cache is invalid.
[0095] Dimension three: Changes in the richness of airlines.
[0096] Determine whether all flights of a certain airline in the cache are invalid. If all are invalid, the entire cache is invalid. If not all are invalid, only the invalid search results are removed from the cache.
[0097] For example,
[0098] The flights in search result 1 include HU001, MU001, and HX001, the flights in search result 2 include HU002, and the flights in search result 3 include HU003, MU002, and MU003. HU refers to Hainan Airlines, HX refers to Hong Kong Airlines, and MU refers to China Eastern Airlines.
[0099] If HX001 in search result 1 is invalid, search result 1 will be invalid only if there is HX in search result 1, so all flights under HX will be invalid, and the entire cache will be invalid.
[0100] If HU002 in search result 2 is invalid, which causes search result 2 to be invalid, and there are flights of HU in other search results, then only the invalid search result will be removed from the cache.
[0101] Dimension 4: The proportion of invalid search results for low-cost routes.
[0102] If there are multiple passengers, the ADT price (i.e. "adult price") will be used as the basis for price comparison to determine the lowest-priced flight. If there is no ADT price, the prices will be compared in the order of child price and infant price.
[0103] The cache invalidation threshold is determined according to the proportion of low-cost routes in the cache, and it is judged whether the number of invalid search results in the low-cost routes exceeds the cache invalidation threshold. If it exceeds, the entire cache is invalidated. If it does not exceed, only the invalid search results are removed from the cache.
[0104] For example,
[0105] When the proportion of low-cost routes in the cache is greater than 20%, the cache invalidation threshold is 10%; when the proportion is less than or equal to 20%, the cache invalidation threshold is 5%.
[0106] Then, when the number of all search results is 100: the number of low-cost routes is 30, which accounts for more than 20%, and should be calculated according to the 10% threshold. When the number of invalid search results in low-cost routes exceeds 30*10%, the entire cache is invalid; the number of low-cost routes is 20, which accounts for less than 20%, and should be calculated according to the 5% threshold. When the number of invalid search results in low-cost routes exceeds 20*5%, the entire cache is invalid.
[0107] Dimension 5: Richness of connections.
[0108] Sort the connecting routes in the cache from shortest to longest flight time. If the top 10% of search results are invalid, the entire search result cache is invalid. If not all of them are invalid, only the invalid search results are removed from the cache.
[0109] For connecting routes with only one transfer point, if all flights at the transfer point are invalid, the entire cache will be invalidated. If not all flights are invalidated, only the invalid search results will be removed from the cache.
[0110] For example,
[0111] Search result 1: The outbound flight is direct, and the return flight transits at MFM or TPE; Search result 2: The outbound flight transits at HKG or CAN, and the return flight transits at MFM; Search result 3: The outbound flight transits at HKG or CAN, and the return flight transits at MFM or TPE; Search result 4: The outbound flight is direct, and the return flight transits at SZX. Among them, MFM refers to Macau International Airport, TPE refers to Taipei Taoyuan International Airport, HKG refers to Hong Kong International Airport, CAN refers to Guangzhou Baiyun International Airport, and SZX refers to Shenzhen Bao'an International Airport.
[0112] If the availability of the outbound space of search result 4 changes, search result 4 will become invalid. Meanwhile, in the cache, only search result 4 is in transit at SZX, so the entire cache will become invalid.
[0113] By processing the cache through the above five dimensions, if invalid search results are frequently deleted, that is, the cache is frequently edited, it means that the origin, destination, and date corresponding to the cache are highly popular, and the freight rates and available space change rapidly. In this case, if the latest information is not updated in time after the search results are deleted, higher-demand and better-quality routes will be hidden from users for a long time, affecting the user experience.
[0114] Based on this, the cache validity period needs to be shortened after deleting the search results. The cache validity period shortening strategy is determined according to the type of route deleted. The route types include the direct flights, low-cost routes, and routes with the shortest flight time mentioned above.
[0115] For example,
[0116] After editing the cache, the cache validity period is shortened by 2; after deleting direct flights, regardless of the number of deletions, the cache validity period is uniformly shortened by 3; after deleting low-cost routes, regardless of the number of deletions, the cache validity period is uniformly shortened by 2; after deleting the route with the shortest flight time, regardless of the number of deletions, the cache validity period is uniformly shortened by 2.
[0117] If multiple situations mentioned above exist at the same time, the shortening ratios need to be added together. In extreme cases, several situations exist, and the shortening ratios are added together, resulting in a total shortening ratio of 9. Assuming that there are 90 minutes left in the cache validity period, the latest cache validity period is calculated based on the total shortening ratio to be 90 minutes / 9 = 10 minutes.
[0118] After the overall cache failure and shortening of the cache validity period, the processing results of the overall cache failure and shortening of the cache validity period are notified to the active polling module in the form of message notification. For the overall cache failure, the active polling module calls the search engine and gives priority to active polling to obtain the latest search results. For shortening the cache validity period, the active polling module updates the polling cycle.
[0119] An embodiment of the present invention further provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the cache data processing method as described in the above method embodiment.
[0120] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, including: a processor 301, the processor 301 is coupled to a memory 302, and the processor 301 is used to read and execute a computer program stored in the memory 302 to implement the cache data processing method as described in the above method embodiment.
[0121] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cache data processing method, characterized in that: include: Obtain search result cache based on user request; Verifying the validity of search results in the search result cache and obtaining invalid search results; The search result cache is processed based on the invalid search result.
2. The method according to claim 1, characterized in that The verifying the validity of the search results in the search result cache includes: There are three verification dimensions: accuracy verification of available space, correctness verification of exchange rates, and validity verification of freight rates.
3. The method according to claim 1, characterized in that: The processing of the search result cache based on the invalid search results includes: The judgment is made based on five dimensions: the proportion of invalid search results, the proportion of invalid search results in direct flights, changes in the richness of airlines, the proportion of invalid search results in low-cost routes, and the richness of connecting flights.
4. The method according to claim 3, characterized in that The processing of the search result cache includes: There are two processing methods: invalidation of the search result cache as a whole and deletion of invalid search results in the search result information cache.
5. The method according to claim 4, characterized in that After deleting the invalid search results in the search result cache, the method further includes: Shorten the search result cache validity period.
6. The method according to claim 5, characterized in that After the search result cache is completely invalidated and the validity period of the search result cache is shortened, the method further includes: The processing result of the overall invalidation of the search result cache and the shortening of the validity period of the search result cache is notified to the active polling module.
7. A cache data processing system, characterized in that: include: A search engine, used to search according to the departure place, destination, date and other personal search preferences entered by the user at the front end as search conditions, obtain search results, and write the search results into a cache module; A cache module, used to store the search results written by the search engine to form a search result cache; A cache verification module, used to verify the validity of the search results in the search result cache, obtain invalid search results, process the search result cache based on the invalid search results, and notify the active polling module of the processing results; The cabin status query module is used to query the cabin availability status and number of available seats of the flight; The active polling module is used to receive the processing result of the cache verification module on the search result cache, actively call the search engine to obtain the latest search result based on the processing result, and write the latest search result into the cache module.
8. The system according to claim 7, characterized in that The search engine is also used to receive the exchange rate change increment data and the freight rate increment data, and push the exchange rate change increment data and the freight rate increment data to the cache verification module.
9. A computer-readable storage medium, characterized in that: A program or instruction is stored, and when the program or instruction is executed on a computer, the computer is caused to execute the cache data processing method according to any one of claims 1 to 6.
10. An electronic device, characterized in that: comprising a processor coupled to a memory; The processor is used to read and execute the computer program stored in the memory to implement the cache data processing method according to any one of claims 1 to 6.