A data processing method, device and storage medium

By receiving data query requests and determining its valid status based on the timeliness attribute parameters of cached data, the problem of fixed validity period of cached ticket information is solved, and the number of calls to the data source interface can be reduced while ensuring accuracy, thereby reducing operating costs. Improve user experience.

CN112734064BActive Publication Date: 2024-10-18ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910974784.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-14
Publication Date
2024-10-18
Estimated Expiration
2039-10-14

AI Technical Summary

Technical Problem

In the existing technology, the fixed validity period of cached ticket information leads to problems such as unsuccessful ticket purchase, long waiting time, poor user experience and high operating costs.

Method used

By receiving the data query request, obtain the target cached data that matches the query request, and determine its effective status based on the timeliness attribute parameters of the cached data, reduce the number of interface calls to the data source, and flexibly adjust the timeliness of the cached data to ensure accurate caching. Spend.

Benefits of technology

On the premise of ensuring cache accuracy, the number of interface calls to the data source is reduced, operating costs are reduced, user experience is improved, and problems caused by fixed validity periods are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112734064B_ABST
    Figure CN112734064B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, device and storage medium. When a data query request is received, it can determine whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of cache data and at least one attribute parameter value corresponding to the target cache data requested by the data query request. If the target cache data is currently in a valid state, the target cache data is output as the query result. Accordingly, when a data query request is received, it can be determined in real time whether the target cache data is valid at the query time, which makes the timeliness of the target cache data more flexible and no longer limited by a fixed validity period, so that the number of calls to the interface of the data source end can be minimized while ensuring the accuracy of the cache.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a data processing method, device and storage medium. Background Art

[0002] When receiving a ticket query request, major airlines and ticket agents need to obtain ticket information such as seats and fares from the Global Distributed System (GDS), and GDS will charge the caller a considerable fee based on the interface call request. Therefore, major airlines and ticket agents mostly use caching to cache ticket information.

[0003] Currently, major airlines and ticket agents usually set a fixed validity period for cached ticket information. However, this caching mechanism often leads to problems such as unsuccessful ticket purchases and long waiting times, poor user experience, and high operating costs. Summary of the invention

[0004] Multiple aspects of the present application provide a data processing method, device and storage medium, which are used to minimize the number of calls to the interface of the data source while ensuring cache accuracy, thereby ensuring user experience with less operating costs.

[0005] The present application provides a data processing method, including:

[0006] receiving a data query request, wherein the data query request includes data description information;

[0007] Acquire target cache data matching the data description information in a storage unit;

[0008] Acquire at least one attribute parameter value that affects the timeliness of the target cache data;

[0009] Based on the influence relationship between various attribute parameters and the timeliness of cached data and the at least one attribute parameter value, determining whether the target cached data is currently in a valid state;

[0010] If it is determined that the target cache data is currently in a valid state, the target cache data is output as a query result.

[0011] The embodiment of the present application also provides a data processing device, including a memory, a processor, and a communication component;

[0012] The memory is used to store one or more computer instructions;

[0013] The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for:

[0014] Receiving a data query request through the communication component, wherein the data query request includes data description information;

[0015] Acquire target cache data matching the data description information in a storage unit;

[0016] Acquire at least one attribute parameter value that affects the timeliness of the target cache data;

[0017] Based on the influence relationship between various attribute parameters and the timeliness of cached data and the at least one attribute parameter value, determining whether the target cached data is currently in a valid state;

[0018] If it is determined that the target cache data is currently in a valid state, the target cache data is taken as a query result and output through the communication component.

[0019] The present application also provides a data processing method, including:

[0020] Monitoring a cache data update request, and determining a plurality of source data that have been called by the cache data update request;

[0021] Obtaining the invalidation degree of cache data associated with the plurality of source data;

[0022] According to the degree of failure, the interface calling conditions are adjusted.

[0023] The embodiment of the present application also provides a data source end, including a memory, a processor and a communication component;

[0024] The memory is used to store one or more computer instructions;

[0025] The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for:

[0026] Monitoring a cache data update request, and determining a plurality of source data that have been called by the cache data update request;

[0027] Obtaining the invalidation degree of cache data associated with the plurality of source data;

[0028] According to the degree of failure, the interface calling conditions are adjusted.

[0029] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned data processing method.

[0030] In an embodiment of the present application, when a data query request is received, it is possible to determine whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of the cache data and at least one attribute parameter value corresponding to the target cache data requested by the data query request. If the target cache data is currently in a valid state, the target cache data is output as the query result. Accordingly, when a data query request is received, it is possible to determine in real time whether the target cache data is valid at the query time, which makes the timeliness of the target cache data more flexible and no longer limited by a fixed validity period, so that the number of calls to the interface on the data source end can be minimized while ensuring the accuracy of the cache. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0032] Figure 1 A flowchart of a data processing method provided in one embodiment of the present application;

[0033] Figure 2 This is a logical diagram of a data processing method in a ticket caching scenario in one embodiment of the present application;

[0034] Figure 3 A schematic diagram of the structure of a data processing device provided in another embodiment of the present application;

[0035] Figure 4 A flowchart of a data processing method provided in yet another embodiment of the present application;

[0036] Figure 5 A structural diagram of a data source end provided for yet another embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0038] Compared with writing data to a hard disk for persistent storage, caching can better meet the speed requirements of data query and update, especially for memory-based caching, which can effectively improve data processing speed.

[0039] At present, the timeliness of cached data in the cache is usually determined based on a fixed validity period TTL (Time To Live). During the TTL period, the cached data is valid, and when the TTL ends, the cached data will become invalid. This method of determining timeliness is relatively rigid, and often leads to problems such as unsuccessful ticket purchases and long waiting times, poor user experience and high operating costs. Therefore, it is a research goal of the embodiments of the present application to more reasonably determine the timeliness of cached data so as to minimize the number of calls to the interface on the data source side while ensuring the accuracy of the cache, thereby ensuring user experience with less operating costs.

[0040] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0041] Figure 1 A flowchart of a data processing method provided in one embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0042] 100. Receive a data query request, where the data query request includes data description information;

[0043] 101. Acquire target cache data matching the data description information in a storage unit;

[0044] 102. Obtain at least one attribute parameter value that affects the timeliness of the target cache data;

[0045] 103. Determine whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of the cache data and the at least one attribute parameter value;

[0046] 104. If it is determined that the target cache data is currently in a valid state, output the target cache data as a query result.

[0047] The data processing method provided in the embodiment of the present application can be applied to various data caching scenarios, especially those scenarios that need to balance the cache accuracy and the number of calls to the data source, such as ticketing scenarios such as air ticket caching and train ticket caching, commodity bidding scenarios, etc. Of course, this embodiment is not limited to this, and this embodiment can also be used in other scenarios where there is cached data locally, there is a need to obtain data from the data source, and the effectiveness of the local cache will change. This embodiment does not specifically limit the application scenario.

[0048] In different application scenarios, the specific implementation forms of data query requests and target cache data are not exactly the same. For example, in the above-mentioned ticketing scenario, the data query request can be implemented as a ticket query request or a train ticket query request, and the target cache data can be implemented as ticket information or train ticket information. In addition, in different application scenarios, different cache data storage granularities and data structures can be set to meet different data query requirements and achieve refined management. Moreover, non-volatile memory NVM and solid-state drive SSD can be used to build cache scenarios to avoid cache data loss caused by device power failure.

[0049] In an embodiment of the present application, when a data query request is received, the data description information contained in the data query request can be obtained. For example, for an air ticket query request, the departure place, destination, departure time, return time, cache update time, flight preference, flight number, one-way / return trip, or whether a baby seat is required, and other air ticket description information can be obtained from the air ticket query request.

[0050] Based on the data description information obtained from the data query request, the target cache data requested by the data query request can be determined in the storage unit. Continuing with the above example, based on the above ticket description information contained in the ticket query request, the ticket information of the target flight matching the ticket description information can be queried from the cache.

[0051] In this embodiment, the storage unit may store cache data in a dynamic cache manner, that is, the size of the cache space of the storage unit may change with the change of the amount of cache data.

[0052] When the target cache data is determined, in the embodiment of the present application, the timeliness of the target cache data will continue to be determined, that is, whether the target cache data is valid at the current query time. To this end, in the embodiment of the present application, at least one attribute parameter value that affects the timeliness of the target cache data can be obtained.

[0053] Among them, in the embodiment of the present application, at least one attribute parameter that has an impact on the timeliness of the cached data in the cache can be pre-configured, and the influence relationship between various attribute parameters and the timeliness of the cached data can be determined. For different cached data, the attribute parameters that have an impact on their timeliness may not be completely consistent. In addition, the influence relationship between various attribute parameters and the timeliness of different cached data may not be completely the same, and this embodiment does not limit this.

[0054] In this embodiment, the attribute parameters that affect the timeliness of the cached data can be configured according to the actual situation. In different application scenarios, the attribute parameters that affect the cached data may not be exactly the same. For example, in the air ticket cache scenario, the attribute parameters may be the departure place, destination, departure time, return time, cache update time, special holidays, route popularity, flight preference, time interval to the departure date, number of remaining tickets, flight number, one-way, return, or whether a baby seat is needed, etc. Among them, the number of remaining tickets can be obtained from the cached data.

[0055] Based on this, in this embodiment, the attribute parameter value of the target cache data under at least one attribute parameter can be obtained. It is worth noting that the attribute parameter values ​​under some or all of the at least one attribute parameter pre-configured to have an impact on the timeliness of the cache data can be obtained here, and this embodiment does not limit this.

[0056] In addition, the acquisition source of at least one attribute parameter value that has an impact on the timeliness of the target cache data can be multiple aspects. On the one hand, it can come from the data description information obtained from the data query request, for example, the departure place, destination, departure time, return time, flight preference, flight number, cache update time, single / return or whether a baby seat is needed in the above-mentioned ticket cache scenario. On the other hand, it can come from the inherent attribute information of the target cache data itself, for example, the attribute parameter values ​​such as the number of remaining tickets and route popularity in the above-mentioned ticket cache scenario. On the one hand, it can also come from the derivative information determined based on the data description information and the inherent attribute information of the target cache data, for example, the time interval from the departure date in the above-mentioned ticket cache scenario is calculated based on the departure time in the data description information and the departure time in the inherent attribute information of the ticket. Of course, this is only exemplary, and the present embodiment is not limited to the acquisition sources of these aspects. The acquisition source of at least one attribute parameter value that has an impact on the timeliness of the target cache data can also be other aspects.

[0057] According to the acquired at least one attribute parameter value affecting the timeliness of the target cache data, it can be determined whether the target cache data is currently in a valid state based on the influence relationship between the attribute parameter involved and the timeliness of the cache data.

[0058] If it is determined that the target cache data is currently valid, the target cache data is output as the query result. In this case, there is no need to call the interface on the data source side.

[0059] If it is determined that the target cache data is currently in an invalid state, the latest content of the target cache data can be obtained from the data source end as the query result output. In this case, it is necessary to call the interface of the data source end. In addition, in actual applications, the latest content of the target cache data obtained from the data source end can also be synchronized to other storage units. For example, in the air ticket caching scenario, the aforementioned latest content can be synchronized to the server of other air ticket sellers.

[0060] For different application scenarios, the data source end may be different. In this embodiment, the data source end generally refers to the data end that provides source data through an interface. For example, for the application scenario of ticket cache, the data source end may be the Global Distributed System (GDS).

[0061] In this embodiment, when a data query request is received, it can be determined whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of cache data and at least one attribute parameter value corresponding to the target cache data requested by the data query request. If the target cache data is currently in a valid state, the target cache data is output as a query result. Accordingly, when a data query request is received, it can be determined in real time whether the target cache data is valid at the query time, which makes the timeliness of the target cache data more flexible and no longer limited by a fixed validity period, so that the number of calls to the interface on the data source end can be minimized to balance the cache hit rate and accuracy in the data processing process.

[0062] The inventor discovered during the research that, in the process of data processing, in order to minimize the number of times the data source is called, it is expected to hit the query results in the storage unit as much as possible, that is, to expect a higher cache hit rate, which usually requires the TTL to be configured as long as possible. However, since the data in the data source is constantly changing, the cached data in the cache may be inconsistent with the actual data in the data source after a period of time. If the cached data is still used blindly, the data processing results will be inaccurate. Therefore, in the process of data processing, it is also expected that the cached data hit is as accurate as possible, which usually requires the TTL to be configured as short as possible.

[0063] Accordingly, in the above or below embodiments, the timeliness of the target cache data may be flexibly adjusted to achieve a balance between the cache hit rate and the cache accuracy.

[0064] In this embodiment, based on the influence relationship between various attribute parameters and the timeliness of cached data, the probability of the target cache data being invalid during the period to be analyzed can be calculated according to at least one attribute parameter value corresponding to the target cache data. The period to be analyzed is the period between the current query time and the time when the target cache data was last identified as being in a valid state; based on the probability of the target cache data being invalid during the period to be analyzed, it is determined whether the target cache data is currently in a valid state.

[0065] In this embodiment, at least one attribute parameter that affects the target cache data can be configured based on the change pattern of the source data corresponding to the target cache data in the data source end. In practical applications, the attribute parameter that affects the change frequency of the source data in the data source end can be determined as the attribute parameter that affects the timeliness of the target cache data, which can more intuitively and comprehensively discover the attribute parameter that affects the timeliness of the target cache data.

[0066] In this way, the influence relationship between various attribute parameters and the timeliness of cached data can be determined by discovering the influence relationship between various attribute parameters and the change frequency of source data in the data source end. By associating the change frequency of source data with the timeliness of cached data, the timeliness of cached data can be matched with the change of source data in the data source end as much as possible.

[0067] For example, in the application scenario of ticket caching, the fewer the remaining tickets, the faster the frequency of changes in the ticket source information will be, or the shorter the time interval to the departure date, the faster the frequency of changes in the ticket source information will be. The timeliness of the ticket cache information in the cache should also be configured synchronously.

[0068] Based on this, the influence relationship between various attribute parameters and the frequency of changes in the ticket source information can be found, thereby determining the influence relationship between various attribute parameters and the timeliness of the cached ticket information in the cache. Among them, the changes in the ticket source information include but are not limited to changes in the cabin, the number of remaining tickets, and the price.

[0069] Based on the influence relationship between various attribute parameters and the change frequency of source data in the data source end, the probability of source data changing within a period of time can be predicted. Based on this, based on the influence relationship between various attribute parameters and the timeliness of cached data, the probability of target cached data being invalid within a period of time can be predicted. The period of time mentioned here can be a period of any length.

[0070] Based on this, in order to determine whether the target cache data is currently in a valid state, the period between the current query time and the time when the target cache data was last identified as being in a valid state can be used as the period to be analyzed (that is, the "period of time" mentioned above). By predicting the probability of the target cache data becoming invalid within the period to be analyzed, it is determined whether the target cache data is currently in a valid state.

[0071] If the probability that the target cache data is invalid during the period to be analyzed is greater than a preset first probability threshold, determining that the target cache data is currently in an invalid state;

[0072] If the probability that the target cache data is invalid during the period to be analyzed is less than a preset second probability threshold, determining that the target cache data is currently in a valid state;

[0073] The preset first probability threshold and the preset second probability threshold can be set according to actual conditions, and the preset first probability threshold is greater than or equal to the preset second probability threshold. For example, the preset first probability threshold and the preset second probability threshold can both be set to 0.85. This embodiment does not limit the specific values ​​of the preset first probability threshold and the preset second probability threshold.

[0074] In addition, in this embodiment, when determining the above-mentioned time period to be analyzed, the last time the target cache data was determined to be in a valid state includes but is not limited to:

[0075] The last time a data query request for the target cache data was received, it was determined that the target cache data was in a valid state at that time; or

[0076] The time when the most recent active update event for the target cache data occurs is considered that the target cache data is in a valid state at that time.

[0077] Among them, the active update event for the target cache data can be, when the data query request for the target cache data is received last time, if the target cache data is determined to be in an invalid state at that time, the latest content of the target cache data is obtained from the data source end as the query result output, and the target cache data is updated based on the latest content obtained. Of course, it can also be the most recent update event for the target cache data based on other trigger conditions. This embodiment is not limited to this.

[0078] Figure 2 FIG. 1 is a logic diagram of a data processing method in a ticket cache scenario in an embodiment of the present application. Figure 2As shown, the user can input the departure place, destination, departure time, return time, etc. of the ticket description information through the terminal device 1. Based on the ticket description information, the terminal device 1 will generate a ticket query request. In this embodiment, when the ticket query request is received, the ticket cache information that the user wants to query can be determined based on the ticket description information, for example, the ticket cache information of one or more flights. And the attribute parameters such as the remaining tickets, the time from the departure date, special holidays, and flight popularity corresponding to the ticket cache information can be determined. Based on this series of attribute parameters, the machine learning model 2 can predict the probability of the current invalidation of the ticket cache information based on the influence relationship between the pre-learned attribute parameters and the timeliness of the ticket cache information. If the predicted invalidation probability is greater than the preset probability threshold of 0.85, it can be determined that the current ticket cache information in the storage unit 3 has expired. In this case, GDS4 can be called to obtain the ticket source information corresponding to the ticket cache information, and the query result can be returned to the user based on the ticket source information. If the predicted invalidation probability is less than the preset probability threshold of 0.85, it can be determined that the current ticket cache information is valid. In this case, the query result can be returned to the user based on the ticket cache information.

[0079] In this embodiment, the TTL of the target cache data is no longer explicitly configured. Instead, the source data in the data source is predicted to have changed at the current query time based on the dynamic changes of the source data in the data source end, so as to determine whether the target cache data is in a valid state at the current query time. In this way, the timeliness of the target cache data can be kept consistent with the changes of the source data in the data source end as much as possible, and the number of calls to the data source end can be minimized, balancing the cache hit rate and accuracy.

[0080] In the above or below embodiments, a machine learning model may be used to determine whether the target cache data is currently in a valid state.

[0081] In this embodiment, the machine learning model can be pre-trained by learning the changing patterns of the source data in the data source end.

[0082] In practical applications, valid result data and at least one attribute parameter involved in multiple historical data query processes can be obtained, and a time series can be formed in the order of query time as a training sample. Based on the training samples, a machine learning algorithm that can handle time series problems, such as the time recursive neural network algorithm LSTM or the autoregressive integrated moving average algorithm ARIMA, can be used to fit the influence relationship between various attribute parameters and the timeliness of cached data to obtain a machine learning model.

[0083] For example, in the air ticket cache scenario, the OD information of each historical air ticket query process, the time interval to the departure date, the remaining ticket information and other attribute parameters, the query time and the actual ticket price at that time, etc. can be obtained. The actual ticket price information at that time can be used as the effective result data in the previous text, and the information involved in multiple historical air ticket query processes is arranged into a time series according to the query time as a training sample. The LSTM machine learning model can be trained based on the training samples to determine the model parameters such as the weight matrix and bias term of the input gate, forget gate and output gate in the model. These model parameters are used to characterize the influence relationship between each attribute parameter and the state information such as the air ticket price, that is, to characterize the influence relationship between each attribute parameter and the timeliness of the air ticket cache information in the cache.

[0084] Based on this, through learning from a large number of training samples, the machine learning model can obtain knowledge such as under what circumstances the source data at the data source will change and the influence of various attribute parameters on the change frequency. Based on the correlation between the change frequency of the source data and the timeliness of the cached data, the machine learning model also learns the influence relationship between various attribute parameters and the timeliness of the cached data. Based on this, the trained machine learning model can be used to predict the probability of the target cached data becoming invalid within a period of time.

[0085] In this embodiment, at least one attribute parameter value corresponding to the target cache data can be used as an input parameter of the machine learning model, and the probability of the target cache data being invalid during the period to be analyzed caused by each of the at least one attribute parameter values ​​is calculated respectively; according to the influence weight of each of the at least one attribute parameter on the timeliness of the target cache data, the probability of the target cache data being invalid during the period to be analyzed caused by each of the at least one attribute parameter values ​​is weighted summed to determine the probability of the target cache data being invalid during the period to be analyzed.

[0086] The weights of the impact of different attribute parameters on the timeliness of the target cache data can be discovered by the machine learning model based on training samples, or can be set based on experience and configured as a basic parameter in the machine learning model, which is not limited in this embodiment. For example, in the application scenario of air ticket caching, the weight of the impact of the number of remaining tickets can be higher than the weight of the impact of travel time.

[0087] In this embodiment, the machine learning model can more accurately learn the influence relationship between various attribute parameters and the timeliness of cached data, so as to more reasonably and accurately predict whether the target cached data is currently in a valid state.

[0088] In addition, although only one machine learning model's processing logic is described in detail above, it is worth noting that, in this embodiment, multiple machine learning models can be configured at the same time, and a one-click model switching mode can be adopted to select which machine learning model to run according to usage requirements. Among them, the model parameters of different machine learning models may not be exactly the same, and the logical structures in different machine learning models may not be exactly the same. For example, in machine learning model A, there is no need to calculate the probability that the target cache data will fail during the period to be analyzed, but directly determine that the target cache data is currently in an invalid state. Machine learning model A is particularly suitable for situations where the accuracy of query results is required to be high. Therefore, when faced with query requests with high accuracy requirements, you can switch to machine learning model A with one click, and determine the query results based on the output results of machine learning model A.

[0089] Of course, this is merely exemplary and is not limited to this embodiment.

[0090] In the above or below embodiments, in scenarios where there is user ordering behavior such as ticket caching, when the probability of the target cache data being invalid during the period to be analyzed is greater than a preset first probability threshold, linear compensation can be performed on the probability of the target cache data being invalid during the period to be analyzed based on the user's search and purchase comparison to optimize the accuracy of the probability of the target cache data being invalid during the period to be analyzed. And according to the compensated probability of the target cache data being invalid during the period to be analyzed, it can be determined whether the target cache data is currently in a valid state.

[0091] Taking the air ticket cache scenario as an example, if the probability that the air ticket cache information is invalid during the period to be analyzed is greater than the preset first probability threshold, it can be determined whether the user who initiates the data query request has a historical ordering behavior; if so, the query-to-purchase ratio corresponding to the user is obtained, and the probability that the air ticket cache information is invalid during the period to be analyzed is linearly compensated based on the query-to-purchase ratio corresponding to the user; based on the probability that the compensated air ticket cache information is invalid during the period to be analyzed, it is determined whether the target cache data is currently in a valid state.

[0092] Further, in this exemplary scenario, if the user who initiates the data query request has a historical ordering behavior, it can be determined whether the query-to-purchase ratio corresponding to the user is greater than or equal to the preset query-to-purchase ratio threshold. If the query-to-purchase ratio corresponding to the user is greater than or equal to the preset query-to-purchase ratio threshold, the probability of the ticket cache information being invalid during the period to be analyzed is linearly compensated according to the first compensation coefficient; if the query-to-purchase ratio corresponding to the user is less than the preset query-to-purchase ratio threshold, the probability of the ticket cache information being invalid during the period to be analyzed is linearly compensated according to the second compensation coefficient; wherein the first compensation coefficient is greater than the second compensation coefficient, and the query-to-purchase ratio refers to the ratio of the number of purchases to the number of queries. In this embodiment, the query-to-purchase ratio threshold can be preset according to actual needs and is not limited here.

[0093] For example, the query-to-purchase ratio threshold may be set to 0.25. When the query-to-purchase ratio of the user who initiated the current air ticket query request is greater than or equal to 0.25, the probability of the air ticket cache information being invalid during the period to be analyzed may be linearly compensated according to the first compensation coefficient of 1.15; when the query-to-purchase ratio of the user who initiated the current air ticket query request is less than 0.25, the probability of the air ticket cache information being invalid during the period to be analyzed may be linearly compensated according to the second compensation coefficient of 1.08. If the probability of the compensated air ticket cache information being invalid during the period to be analyzed is less than the aforementioned preset second probability threshold, it may be determined that the air ticket cache information is currently in a valid state; and if the probability of the compensated air ticket cache information being invalid during the period to be analyzed is still greater than the aforementioned preset first probability threshold, it may be determined that the air ticket cache information is currently in an invalid state.

[0094] If the user who initiates the data query request has no historical ordering behavior, linear compensation may no longer be performed. Of course, linear compensation may also be performed based on the average query-to-purchase ratio, where the average query-to-purchase ratio refers to the ratio of the number of orders caused by all users to the number of queries.

[0095] In this embodiment, the probability of the target cache data being invalid during the period to be analyzed is compensated based on the user's query and purchase ratio. This allows the real air ticket information to be returned as much as possible to users with a relatively high probability of purchasing a ticket, while the air ticket cache information is returned as much as possible to users with a relatively low probability of purchasing a ticket. This can effectively ensure the accuracy of the air ticket information obtained by users with a relatively high probability of purchasing a ticket and save unnecessary cache update costs.

[0096] In the above or below embodiments, the cache data in the cache may also be actively updated from multiple aspects. Hereinafter, the technical solution will be described by taking the target cache data as an example.

[0097] On the one hand, after outputting the query results, it is possible to verify whether the target cache data is consistent with the source data, and actively update the target cache data if it is found that the target cache data is inconsistent with the source data.

[0098] For example, in the application scenario of air ticket cache, when the target cache data is air ticket cache information, the order request submitted to the data source for the air ticket cache information can continue to be monitored; if the data source returns a notification message of order failure, the air ticket cache information is updated.

[0099] Among them, the data source may return a notification message of order failure in the following situations: the number of sheets ordered in the order request is multiple and the data source returns a notification message of order failure; or the number of sheets ordered in the order request is one and the data source returns a notification message of order failure.

[0100] For the first case, the ticket source information corresponding to the ticket cache information can be obtained from the data remote end, and the ticket cache information can be updated based on the obtained ticket source information. Among them, the ticket source information contains the current actual number of remaining tickets, and the ticket cache information can be updated according to the actual number of remaining tickets. For the second case, there is no need to call the data source end, and the number of remaining tickets in the ticket cache information can be directly updated to zero. Of course, the data source end can also be called to confirm the number of remaining tickets.

[0101] In addition, if the data source returns a notification message indicating that the order is successful, the number of remaining tickets in the ticket cache information can be updated based on the number of tickets ordered in the order request. In this case, it means that the number of remaining tickets is still sufficient, so it is considered that the possibility of source data changes is small. Although this method of autonomously updating the target cache data does not update the target cache data by calling the data source, the update operation can ensure that the target cache data is closer to the changes in the source data.

[0102] On the other hand, the target cache data may be actively updated when a trigger event occurs. The trigger event may be a timer event or an event occurring based on other trigger conditions, which is not limited in this embodiment.

[0103] For example, in the application scenario of ticket cache, the remaining ticket threshold can be set in advance, and the number of remaining tickets in the ticket cache information can be monitored; if the number of remaining tickets in the ticket cache information is monitored to be less than the preset remaining ticket threshold, the latest ticket information of the target flight is obtained from the data source; the ticket cache information is updated based on the latest ticket information obtained. In this example, the remaining ticket threshold is used as a trigger condition. Among them, the remaining ticket threshold can be flexibly set according to actual conditions. For example, the remaining ticket threshold can be set to 8, which is not limited in this embodiment. In addition, the operation of monitoring the number of remaining tickets in the ticket cache information can be performed periodically, for example, once every 10 minutes; it can also be performed when the remaining tickets in the ticket cache information change. For example, when the user successfully orders and the number of remaining tickets in the ticket cache information has been updated based on the number of tickets ordered, it can be monitored whether the updated number of remaining tickets is less than the preset remaining ticket threshold. Of course, this embodiment is not limited to this.

[0104] For another example, a timer can be set to regularly update the cached data in the cache, that is, by calling the data source end, all the cached data in the cache is updated. The full update can be performed when the computing resources are relatively idle.

[0105] It is worth noting that although the active update operation involved in this embodiment will result in a call to the data source end, the number of calls to the data source end caused by the active update is negligible compared to the number of times the cached data in the cache cannot be hit and the data source end needs to be called to process the data query request. The cache hit rate and accuracy improved based on the active update operation can effectively reduce the number of calls to the data source end caused by the data query request.

[0106] In the above or following embodiments, when it is determined that the target cache data is currently in a valid state, the recommended update time corresponding to the target cache data can be determined according to the probability of the target cache data becoming invalid during the period to be analyzed; at the recommended update time, the source data corresponding to the target cache data is obtained from the data source to update the target cache data.

[0107] As described above, the probability of the target cache data being invalid during the period to be analyzed can be calculated to determine whether the target cache data is currently in a valid state. In this embodiment, when it is determined that the target cache data is currently in a valid state, the calculated probability of the target cache data being invalid during the period to be analyzed can be used to determine the recommended update time corresponding to the target cache data.

[0108] For example, if the calculated probability of the target cache data being invalid during the period to be analyzed is 0.75, and it is determined that the target cache data is currently valid, the recommended update time corresponding to the target cache data can be determined to be the current time plus 5 minutes. That is, when the current time is 10:00, the recommended update time is 10:05.

[0109] Among them, in this embodiment, the correspondence between the probability of target cache data being invalid during the period to be analyzed and the recommended update time can be set according to actual needs. For example, the recommended update time may increase by 5 minutes for every 0.5 decrease in the probability. Of course, there may be other correspondences, which are not limited in this embodiment.

[0110] Accordingly, in this embodiment, when it is determined that the target cache data is currently in a valid state, the target cache data can continue to be actively updated, thereby providing more accurate query results for subsequent data query requests for the target cache data.

[0111] In the above or following embodiments, the cache data in the storage unit may be actively updated globally by periodic updating, wherein the initial value of the global update period may be a fixed value, for example, 30 minutes. Of course, it may be a random value, which is not limited in this embodiment.

[0112] Based on the initial value of the global update period, in this embodiment, the global update period can be dynamically adjusted during the query process.

[0113] In this embodiment, the proportion of cached data as query results in multiple data query requests received within a period of time may be counted; and the global update period of cached data in the storage unit may be adjusted according to the proportion.

[0114] In this embodiment, the length of the aforementioned period of time is not limited, for example, it can be 5 minutes, 10 minutes, 1 hour or 2 hours, etc. The length of time can be set and adjusted according to actual needs.

[0115] For each data query request, you can monitor whether the corresponding query result is directly from the cached data or updated from the data source. Thus, you can count the proportion of data query requests with cached data as query results to the total number of data query requests within a period of time.

[0116] According to the ratio, the aforementioned global update period can be adjusted.

[0117] The larger the ratio is, the more cache data in the storage unit is in a valid state. In this case, the global update cycle can be appropriately extended to save update costs. The smaller the ratio is, the more cache data in the storage unit is in an invalid state. In this case, the global update cycle can be appropriately shortened to improve the validity of the cache data in the storage unit.

[0118] In this embodiment, by dynamically adjusting the global update cycle, a balance between data validity and update cost can be achieved, thereby maximizing the validity of cache data in the storage unit with less update cost.

[0119] Figure 3 This is a structural diagram of a data processing device provided by another embodiment of the present application. Figure 3 As shown, the data processing device includes: a memory 30 , a processor 31 and a communication component 32 .

[0120] The memory 30 is used to store computer programs and can be configured to store various other data to support operations on the data processing device. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0121] The processor 31 is coupled to the memory 30 and the communication component 32, and is used to execute the computer program in the memory to:

[0122] Receiving a data query request through the communication component 32, the data query request including data description information;

[0123] Obtaining target cache data matching the data description information in the storage unit;

[0124] Obtain at least one attribute parameter value that affects the timeliness of target cache data;

[0125] Determine whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of the cache data and at least one attribute parameter value;

[0126] If it is determined that the target cache data is currently in a valid state, the target cache data is taken as a query result and output through the communication component 32 .

[0127] In an optional embodiment, when the processor 31 determines whether the target cache data is currently in a valid state based on the influence relationship between various attribute parameters and the timeliness of the cache data and at least one attribute parameter value, it is configured to:

[0128] Based on the influence relationship between various attribute parameters and the timeliness of cached data, according to at least one attribute parameter value corresponding to the target cached data, the probability of the target cached data being invalid during the period to be analyzed is calculated, and the period to be analyzed is the period between the current query time and the time when the target cached data was last determined to be in a valid state;

[0129] According to the probability that the target cache data is invalid during the period to be analyzed, it is determined whether the target cache data is currently in a valid state.

[0130] In an optional embodiment, when the processor 31 determines whether the target cache data is currently in a valid state according to the probability that the target cache data is invalid during the period to be analyzed, it is configured to:

[0131] If the probability that the target cache data is invalid during the period to be analyzed is greater than a preset first probability threshold, determining that the target cache data is currently in an invalid state;

[0132] If the probability that the target cache data is invalid during the period to be analyzed is less than a preset second probability threshold, determining that the target cache data is currently in a valid state;

[0133] The preset first probability threshold is greater than or equal to the preset second probability threshold.

[0134] In an optional embodiment, when the target cache data is ticket cache information, the processor 31 is specifically configured to:

[0135] If the probability that the cached ticket information is invalid during the period to be analyzed is greater than a preset first probability threshold, determining whether the user who initiated the data query request has a historical ordering behavior;

[0136] If it exists, then obtain the search-to-purchase ratio corresponding to the user, and perform linear compensation on the probability of the cached air ticket information being invalid during the period to be analyzed based on the search-to-purchase ratio corresponding to the user;

[0137] According to the probability of the compensated ticket cache information being invalid during the period to be analyzed, it is determined whether the target cache data is currently in a valid state.

[0138] In an optional embodiment, when the processor 31 uses the search and purchase ratio corresponding to the user to perform linear compensation on the probability of the cached air ticket information being invalid during the period to be analyzed, it is configured to:

[0139] If the search-to-purchase ratio corresponding to the user is greater than or equal to a preset search-to-purchase ratio threshold, linear compensation is performed on the probability of the ticket cache information being invalid during the period to be analyzed according to the first compensation coefficient;

[0140] If the search-to-purchase ratio corresponding to the user is less than a preset search-to-purchase ratio threshold, a linear compensation is performed on the probability of the ticket cache information being invalid during the period to be analyzed according to the second compensation coefficient;

[0141] The first compensation coefficient is greater than the second compensation coefficient, and the query-to-purchase ratio is the ratio of the number of purchases to the number of queries.

[0142] In an optional embodiment, when the processor 31 determines whether the target cache data is currently in a valid state according to the probability that the compensated ticket cache information is invalid during the period to be analyzed, it is configured to:

[0143] If the probability that the compensated ticket cache information is invalid during the period to be analyzed is less than a preset second probability threshold, determining that the target cache data is currently in a valid state;

[0144] If the probability that the compensated ticket cache information is invalid during the time period to be analyzed is greater than a preset first probability threshold, it is determined that the target cache data is currently in an invalid state.

[0145] In an optional embodiment, when the processor 31 calculates the probability that the target cache data is invalid during the time period to be analyzed according to at least one attribute parameter value corresponding to the target cache data, it is configured to:

[0146] Using at least one attribute parameter value corresponding to the target cache data as an input parameter of the machine learning model, respectively calculating the probability that the target cache data is invalid during the time period to be analyzed due to each of the at least one attribute parameter values;

[0147] According to the influence weight of at least one attribute parameter on the timeliness of the target cache data, the probability of the target cache data being invalid during the period to be analyzed caused by each of the at least one attribute parameter values ​​is weighted summed to determine the probability of the target cache data being invalid during the period to be analyzed.

[0148] In an optional embodiment, the processor 31 is further configured to:

[0149] Acquire valid result data and at least one attribute parameter involved in multiple historical data query processes, and form a time series in the order of query time as a training sample, wherein the valid result data is consistent with the source data at the query time;

[0150] The time recursive neural network algorithm or the autoregressive integrated moving average algorithm is used to train the model of the training samples to obtain the machine learning model.

[0151] In an optional embodiment, the last time the processor 31 determined that the target cache data was in a valid state, includes:

[0152] The last time a data query request for the target cache data was received, it was determined that the target cache data was in a valid state at that time; or

[0153] The time when the most recent active update event for the target cache data occurs is considered that the target cache data is in a valid state at that time.

[0154] In an optional embodiment, the processor 31 is further configured to:

[0155] If it is determined that the target cache data is currently in an invalid state, the latest content of the target cache data is obtained from the data source and output as the query result;

[0156] Update the target cache data based on the latest content obtained.

[0157] In an optional embodiment, the target cache data is ticket cache information.

[0158] In an optional embodiment, after outputting the target cache data as the query result, the processor 31 is further configured to:

[0159] Continue to monitor the order requests submitted to the data source for the target flight;

[0160] If the data source returns a notification message indicating that the order has failed, the ticket cache information is updated.

[0161] In an optional embodiment, when the processor 31 executes the updating of the ticket cache information if the data source returns a notification message of order failure, it is used to:

[0162] If the data source returns a notification message indicating that the order has failed and the order request contains multiple tickets, the actual number of remaining tickets is obtained from the data source, and the number of remaining tickets in the ticket cache information is updated according to the actual number of remaining tickets; or

[0163] If the data source returns a notification message indicating that the order has failed and the number of tickets ordered in the order request is one, the number of remaining tickets in the ticket cache information is updated to zero.

[0164] In an optional embodiment, the processor 31 is further configured to:

[0165] If the data source returns a notification message indicating that the order is successful, the number of remaining tickets in the ticket cache information is updated based on the number of tickets ordered in the order request.

[0166] In an optional embodiment, the processor 31 is further configured to:

[0167] Monitor the number of remaining tickets in the ticket cache information;

[0168] If it is detected that the number of remaining tickets in the ticket cache information is less than the preset remaining ticket threshold, the ticket source information corresponding to the ticket cache information is obtained from the data source end;

[0169] Update the ticket cache information based on the obtained ticket source information.

[0170] In an optional embodiment, the attribute parameters are departure place, destination, departure time, return time, special holidays, route popularity, flight preference, time interval to departure date, number of remaining tickets, flight number, one-way, return, or whether a baby seat is required.

[0171] In an optional embodiment, the processor 31 is further configured to:

[0172] If it is determined that the target cache data is currently in a valid state, determine the recommended update time corresponding to the target cache data according to the probability that the target cache data is invalid during the period to be analyzed;

[0173] At the recommended update time, the source data corresponding to the target cache data is obtained from the data source to update the target cache data.

[0174] In an optional embodiment, the processor 31 is further configured to:

[0175] Statistics on the proportion of cached data as query results among multiple data query requests received within a period of time;

[0176] According to the ratio, the global update period of the cached data in the storage unit is adjusted.

[0177] Further, if Figure 3 As shown, the data processing device also includes: a power supply component 33 and other components.

[0178] Figure 3 Only some components are shown schematically, which does not mean that the data processing device only includes Figure 3 Components shown.

[0179] It is worth noting that the technical details in the above-mentioned embodiments of the data processing device can be referred to the relevant description of the above-mentioned data processing method. In order to save space, they will not be repeated here, but this should not cause loss of the protection scope of this application.

[0180] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by a data processing device in the above method embodiment.

[0181] Figure 4 A flowchart of a data processing method provided by another embodiment of the present application is shown below. Figure 4 As shown, the method includes:

[0182] 400. Monitor the cache data update request and determine the multiple source data that have been called by the cache data update request;

[0183] 401. Obtain the invalidation degree of cache data associated with multiple source data;

[0184] 402. Adjust the interface calling conditions according to the degree of failure.

[0185] The data processing method provided in the embodiment of the present application can be applied to various data caching scenarios, especially those scenarios that need to balance the cache accuracy and the number of calls to the data source, such as ticketing scenarios such as air ticket caching and train ticket caching, commodity bidding scenarios, etc. Of course, this embodiment is not limited to this, and this embodiment can also be used in other scenarios where there is cached data locally, there is a need to obtain data from the data source, and the effectiveness of the local cache will change. This embodiment does not specifically limit the application scenario.

[0186] The data processing method provided in this embodiment is applicable to the data source end in the aforementioned data caching scenario, that is, the data end that provides the source data. In physical implementation, the data source end can be a server device such as a conventional server, a cloud server, a cloud host, a virtual center, etc. Among them, the composition of the server device mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.

[0187] In different application scenarios, the physical implementation form of the data source may not be exactly the same. For example, for the application scenario of ticket cache, the data source is the ticket distribution system.

[0188] The data source end can manage a number of source data, and the source data can be stored locally at the data source end, or can be stored in a storage space managed by the data source end, which is not limited in this embodiment.

[0189] In this implementation, cache data update requests can be monitored, and the cache data update requests can come from different requesters. In actual applications, cache data update requests received within a period of time can be monitored, and multiple source data that have been called by the cache data update requests can be determined. Among them, a single requester may initiate multiple cache data update requests within this period of time.

[0190] Based on this, in this embodiment, the invalidation degree of cache data associated with multiple source data can be obtained. Wherein, the cache data associated with multiple source data refers to the cache data that needs to be updated by the cache update request.

[0191] In one implementation, the proportion of cache data currently in an invalid state among cache data associated with a plurality of source data may be determined as the degree of invalidation.

[0192] Among them, the invalidation status of the cache data can be obtained according to the scheme of judging whether the cache data is currently in a valid state mentioned in the above-mentioned embodiment. In this way, the proportion of cache data currently in an invalid state in the cache data associated with multiple source data can be determined.

[0193] In actual applications, changes in multiple source data can also be monitored; based on the changes in multiple source data, the proportion of source data that has changed within the first unit time period to the multiple source data is counted, which is used as the proportion of cache data that is currently in an invalid state among the cache data associated with the multiple source data.

[0194] The change situation includes the change time, the change content or the change number, etc., which is not limited in this embodiment. The first unit time period can be 5 minutes, 10 minutes or 1 hour, etc., which is not limited in this embodiment. Moreover, in different situations, the length of the first unit time period may not be exactly the same. For example, the length of the first unit time period at night may be greater than the length of the first unit time period during the day, of course, this is only exemplary.

[0195] Based on this, in this embodiment, the interface call conditions for multiple source data can be adjusted according to the invalidation degree of cache data associated with the multiple source data. Among them, the interface call conditions can include the interface call cost, and of course, other restrictions. The requester refers to a device that needs to use multiple source data to update local cache data.

[0196] For example, when the statistical ratio is large, it means that most of the multiple source data have changed in the first unit period, which means that the requester's update requirements will increase, so the interface call conditions are improved. When the statistical ratio is small, it means that only a small part of the multiple source data has changed in the first unit period, which means that the requester's update requirements will decrease, so the interface call conditions can be lowered.

[0197] Accordingly, in this embodiment, the interface calling condition can be adaptively adjusted according to the invalidation status of the cache data associated with the multiple source data.

[0198] In addition, in this embodiment, the invalidation degree of cache data associated with multiple source data can also be actively notified to each requesting party, so that the requesting party can determine whether to actively update.

[0199] Furthermore, in this embodiment, the number of cache data update requests for multiple source data within the second unit time period may be counted; and the interface call condition may be adjusted according to the number of cache data update requests.

[0200] For example, when the number of cache data update requests increases sharply, the interface call conditions can be improved, and when the number of cache data update requests decreases sharply, the interface call conditions can be lowered.

[0201] Accordingly, in this embodiment, the change in the query demand of the requesting party can be discovered according to the number of cache data update requests initiated by the requesting party, so as to adaptively adjust the interface calling conditions.

[0202] Furthermore, in this implementation, specific query periods may be preset, such as holidays, daily peak periods, daily low peak periods, etc. Based on the specific query periods, interface call conditions for multiple source data may be adjusted.

[0203] For example, during holidays, the query demand of the requester will surge, and during this specific query period, the interface call conditions can be improved. For another example, during the off-peak period of the day, the query demand of the requester will drop sharply, and during this specific query period, the interface call conditions can be lowered.

[0204] Accordingly, in this embodiment, the interface calling conditions can be adjusted in different time periods and sections.

[0205] Figure 5 A structural diagram of a data source end provided by another embodiment of the present application is shown in FIG. Figure 5 As shown, the data source includes: a memory 50 and a processor 51.

[0206] The memory 50 is used to store computer programs and can be configured to store various other data to support operations on the data source end device. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0207] The processor 51 is coupled to the memory 50 and is used to execute the computer program in the memory 50 to:

[0208] Monitor cache data update requests, and determine multiple source data that have been called by the cache data update requests;

[0209] Obtaining the invalidation degree of cache data associated with multiple source data;

[0210] Adjust the interface calling conditions according to the degree of failure.

[0211] In an optional embodiment, when acquiring the invalidation degree of cache data associated with a plurality of source data, the processor 51 is configured to:

[0212] The proportion of cache data currently in an invalid state among cache data associated with the plurality of source data is determined as the invalidation degree.

[0213] In an optional embodiment, when determining the proportion of cache data currently in an invalid state among cache data associated with a plurality of source data, the processor 51 is configured to:

[0214] Monitor changes in multiple source data;

[0215] According to changes in the multiple source data, the proportion of the source data that have changed in the first unit period to the multiple source data is counted as the proportion of the cache data that is currently in an invalid state in the cache data associated with the multiple source data.

[0216] In an optional embodiment, the processor 51 is further configured to:

[0217] Counting the number of cache data update requests for multiple source data within the second unit time period;

[0218] Adjust the interface call conditions based on the number of cache data update requests.

[0219] In an optional embodiment, the processor 51 is further configured to:

[0220] Get the preset specific query period;

[0221] Adjust the interface call conditions based on specific query time periods.

[0222] Further, if Figure 5 As shown, the data source end also includes: a communication component 52, a power supply component 53 and other components. Figure 5 Only some components are shown schematically, which does not mean that the data source only includes Figure 5 Components shown.

[0223] It is worth noting that the technical details in the above-mentioned embodiments on the data source end can refer to the relevant description in the aforementioned data processing method. In order to save space, they will not be repeated here, but this should not cause loss of the protection scope of this application.

[0224] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step that can be executed by the data source in the above method embodiment.

[0225] in, Figure 3 and Figure 5 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be implemented based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology or other technologies to facilitate short-range communication.

[0226] in, Figure 3 and Figure 5 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0227] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 100 to 102 can be device A; for another example, the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.

[0228] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 100, 101, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, values, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0229] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0230] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0231] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0232] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0233] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0234] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0235] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0236] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0237] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A data processing method, characterized in that: include: receiving a data query request, wherein the data query request includes data description information; Acquire target cache data matching the data description information in a storage unit; Acquire at least one attribute parameter value that affects the timeliness of the target cache data; Based on the influence relationship between various attribute parameters and the timeliness of cached data, the probability of the target cached data being invalid during the time period to be analyzed is calculated according to the at least one attribute parameter value, and the time period to be analyzed is the time period between the current query time and the time when the target cached data was last determined to be in a valid state; Determining whether the target cache data is currently in a valid state according to the probability that the target cache data is invalid during the period to be analyzed; If it is determined that the target cache data is currently in a valid state, the target cache data is output as a query result.

2. The method according to claim 1, characterized in that Determining whether the target cache data is currently in a valid state according to the probability that the target cache data is invalid during the time period to be analyzed includes: If the probability that the target cache data is invalid during the period to be analyzed is greater than a preset first probability threshold, determining that the target cache data is currently in an invalid state; If the probability that the target cache data is invalid during the period to be analyzed is less than a preset second probability threshold, determining that the target cache data is currently in a valid state; Wherein, the preset first probability threshold is greater than or equal to the preset second probability threshold.

3. The method according to claim 2, characterized in that In the case where the target cache data is ticket cache information, if the probability that the target cache data is invalid during the to-be-analyzed period is greater than a preset first probability threshold, determining that the target cache data is currently in an invalid state includes: If the probability that the cached ticket information is invalid during the time period to be analyzed is greater than the preset first probability threshold, determining whether the user who initiated the data query request has a historical ordering behavior; If so, obtaining the search-to-purchase ratio corresponding to the user, and performing linear compensation on the probability of the cached air ticket information being invalid during the period to be analyzed based on the search-to-purchase ratio corresponding to the user; According to the probability that the compensated ticket cache information is invalid during the time period to be analyzed, it is determined whether the target cache data is currently in a valid state.

4. The method according to claim 3, characterized in that The linear compensation for the probability of the cached air ticket information being invalid during the period to be analyzed based on the search and purchase ratio corresponding to the user includes: If the search-to-purchase ratio corresponding to the user is greater than or equal to a preset search-to-purchase ratio threshold, linearly compensating the probability of the ticket cache information being invalid during the time period to be analyzed according to a first compensation coefficient; If the search-to-purchase ratio corresponding to the user is less than the preset search-to-purchase ratio threshold, linearly compensating the probability of the ticket cache information being invalid during the period to be analyzed according to a second compensation coefficient; The first compensation coefficient is greater than the second compensation coefficient, and the query-to-purchase ratio is the ratio of the number of purchases to the number of queries.

5. The method according to claim 3, characterized in that: The determining whether the target cache data is currently in a valid state according to the probability that the compensated ticket cache information is invalid during the time period to be analyzed includes: If the probability that the compensated ticket cache information is invalid during the time period to be analyzed is less than the preset second probability threshold, determining that the target cache data is currently in a valid state; If the probability that the compensated ticket cache information is invalid during the time period to be analyzed is greater than the preset first probability threshold, it is determined that the target cache data is currently in an invalid state.

6. The method according to claim 1, characterized in that The last time the target cache data was determined to be in a valid state includes: The last time a data query request for the target cache data was received, it was determined that the target cache data was in a valid state at that time; or At the time when the most recent active update event for the target cache data occurs, it is determined that the target cache data is in a valid state at that time.

7. The method according to claim 1, characterized in that The calculating, according to at least one attribute parameter value corresponding to the target cache data, the probability that the target cache data is invalid during the time period to be analyzed includes: Using at least one attribute parameter value corresponding to the target cache data as an input parameter of the machine learning model, and respectively calculating the probability that the target cache data is invalid during the time period to be analyzed due to each of the at least one attribute parameter values; According to the influence weight of each of the at least one attribute parameter on the timeliness of the target cache data, the probability of the target cache data being invalid during the period to be analyzed caused by each of the at least one attribute parameter values ​​is weighted summed to determine the probability of the target cache data being invalid during the period to be analyzed.

8. The method according to claim 7, characterized in that Also includes: Acquire valid result data and at least one attribute parameter involved in multiple historical data query processes, and form a time series in the order of query time as a training sample, wherein the valid result data is consistent with the source data at the query time; A time recursive neural network algorithm is used to perform model training on the training samples to obtain the machine learning model.

9. The method according to claim 1, characterized in that: Also includes: If it is determined that the target cache data is currently in an invalid state, the source data corresponding to the target cache data is obtained from the data source end and output as the query result; The target cache data is updated based on the acquired source data.

10. The method according to any one of claims 1 to 9, characterized in that: The target cache data is ticket cache information.

11. The method according to claim 10, characterized in that After outputting the target cache data as the query result, the method further includes: Continue to monitor the order request submitted to the data source for the cached ticket information; If the data source returns a notification message of order failure, the ticket cache information is updated.

12. The method according to claim 11, characterized in that If the data source returns a notification message indicating that the order has failed, updating the ticket cache information includes: If the data source returns a notification message of order failure and the order number in the order request is multiple, obtain the actual number of remaining tickets from the data source, and update the number of remaining tickets in the ticket cache information according to the actual number of remaining tickets; or If the data source returns a notification message indicating that the order has failed and the number of tickets ordered in the order request is one, the number of remaining tickets in the ticket cache information is updated to zero.

13. The method according to claim 11, characterized in that Also includes: If the data source returns a notification message indicating that the order is successful, the number of remaining tickets in the ticket cache information is updated based on the number of tickets ordered in the order request.

14. The method according to claim 10, characterized in that Also includes: Monitoring the number of remaining tickets in the ticket cache information; If it is detected that the number of remaining tickets in the ticket cache information is less than a preset remaining ticket threshold, the ticket source information corresponding to the ticket cache information is obtained from the data source end; The ticket cache information is updated based on the acquired ticket source information.

15. The method according to claim 7, characterized in that When the target cache data is air ticket cache data, the attribute parameters are departure place, destination, departure time, cache update time, return time, special holidays, route popularity, flight preference, time interval to departure date, number of remaining tickets, flight number, one-way, return or whether a baby seat is required.

16. The method according to claim 1, characterized in that Also includes: If it is determined that the target cache data is currently in a valid state, determining a recommended update time corresponding to the target cache data according to a probability that the target cache data becomes invalid during the period to be analyzed; At the recommended update time, source data corresponding to the target cache data is obtained from the data source end to update the target cache data.

17. The method according to claim 1, characterized in that Also includes: Counting the ratio of the number of data query requests with cached data as query results to the total number of data query requests in the period of time among multiple data query requests received within the period of time; According to the ratio, a global update period of cached data in the storage unit is adjusted.

18. A data processing device, characterized in that: Includes memory, processor, and communication components; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for: Receiving a data query request through the communication component, wherein the data query request includes data description information; Acquire target cache data matching the data description information in a storage unit; Acquire at least one attribute parameter value that affects the timeliness of the target cache data; Based on the influence relationship between various attribute parameters and the timeliness of cached data, the probability of the target cached data being invalid during the time period to be analyzed is calculated according to the at least one attribute parameter value, and the time period to be analyzed is the time period between the current query time and the time when the target cached data was last determined to be in a valid state; Determining whether the target cache data is currently in a valid state according to the probability that the target cache data is invalid during the period to be analyzed; If it is determined that the target cache data is currently in a valid state, the target cache data is taken as a query result and output through the communication component.

19. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the data processing method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Air ticket inquiring cache method

    CN107291920A