Data caching processing method, device and equipment

By dynamically adjusting the cache expiration time, the problem of updated but not expired data in the cache is solved according to the update cycle and volatility parameters of the target data, and the flexibility and accuracy of cache management are improved.

CN119135769APending Publication Date: 2024-12-13BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310695738.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the cache expiration time setting is not flexible enough, resulting in the presence of updated but not expired invalid data in the cache.

Method used

By obtaining multiple update time intervals of the target data within the preset time range, determine its average update period and volatility parameters. If the volatility parameter is less than the threshold, the average update period is determined as the update period of the target data, and dynamically adjust the cache Expiration time.

Benefits of technology

Make the cache expiration time setting more flexible and accurate, reducing the situation of obtaining unexpired invalid data in the cache.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135769A_ABST
    Figure CN119135769A_ABST
Patent Text Reader

Abstract

The invention discloses a data caching processing method, device and equipment, and the method comprises the steps: determining an average updating period according to a plurality of updating time intervals of target data in a preset time range, and further determining the volatility parameters of the plurality of updating time intervals; if the volatility parameter is smaller than the threshold value, it is represented that the volatility of the updating time interval of the target data is not large, that is, the updating period is stable, and the average updating period can be determined as the updating period of the target data. And when the cache expiration time of the target data needs to be set, determining the cache expiration time of the target data according to the updating period of the target data, the latest updating time of the target data and the current time. Therefore, the cache expiration time is dynamically determined according to the average updating period, so that the setting of the cache expiration time is more flexible and accurate, and the condition that the data is updated but non-expired invalid data is obtained from the cache is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Caching technology is widely used in various applications. When an application requests data, if the data is available in the application cache, it can be used directly, thereby shortening the response time of the request and reducing the pressure caused by requesting access to the database or third-party data source.

[0003] For data in the cache that does not require high real-time performance, a cache expiration time will be set for the data. The cache expiration time is a universal configuration that starts from the time the data was last updated. After the set cache expiration time, the expired data will be deleted from the cache.

[0004] The current common cache expiration time setting is generally based on research or development experience to estimate the approximate expiration time of the data, so as to set the cache expiration time. However, the fixed cache expiration time is not flexible enough, which may cause the situation where invalid data in the cache is requested but has not expired but has actually been updated. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a data cache processing method, device and equipment to solve the current technical problem that the cache expiration time setting is not flexible enough.

[0006] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:

[0007] In a first aspect, an embodiment of the present application provides a data cache processing method, the method comprising:

[0008] Acquire multiple update time intervals of the target data within a preset time range, and determine an average update period according to the multiple update time intervals;

[0009] determining a volatility parameter for a plurality of said update time intervals;

[0010] If the volatility parameter is less than a threshold, determining the average update period as the update period of the target data;

[0011] In response to a request to set a cache expiration time for the target data, the cache expiration time of the target data is determined according to an update cycle of the target data, a last update time of the target data and a current time, wherein the cache expiration time is used to indicate an expiration time of the target data in the cache.

[0012] In a second aspect, an embodiment of the present application provides a data cache processing device, the device comprising:

[0013] A first determining unit, configured to obtain a plurality of update time intervals of the target data within a preset time range, and determine an average update period according to the plurality of update time intervals;

[0014] A second determining unit, configured to determine a volatility parameter of a plurality of said update time intervals;

[0015] a third determining unit, configured to determine the average update period as the update period of the target data if the volatility parameter is less than a threshold;

[0016] A fourth determination unit is used to respond to a request to set a cache expiration time of the target data, determine the cache expiration time of the target data according to an update cycle of the target data, a last update time of the target data and a current time, wherein the cache expiration time is used to indicate an expiration time of the target data in the cache.

[0017] In a third aspect, an embodiment of the present application provides a device for determining a cache expiration time, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the data cache processing method as described above is implemented.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the data cache processing method as described above.

[0019] It can be seen that the embodiments of the present application have the following beneficial effects:

[0020] The embodiment of the present application determines an average update period based on multiple update time intervals of the target data within a preset time range, and further determines a volatility parameter of the multiple update time intervals. If the volatility parameter is less than a threshold value, it means that the update time interval of the target data is not very volatile, that is, the update period is relatively stable, and the average update period can be determined as the update period of the target data. When it is necessary to set the cache expiration time of the target data, the cache expiration time of the target data is determined based on the update period of the target data, the last update time of the target data, and the current time. In this way, the cache expiration time is dynamically determined based on the average update period, making the setting of the cache expiration time more flexible and accurate, and greatly reducing the situation where the data has been updated but invalid data that has not expired is obtained from the cache. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of an exemplary application scenario of a system architecture provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;

[0023] Figure 3 A flowchart of a data cache processing method provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of a data cache processing device provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0027] In order to facilitate understanding and explanation of the technical solution provided by the embodiments of the present application, the background technology of the embodiments of the present application will be described below.

[0028] Caching technology is widely used in various applications. When an application requests data, if the data is in the application cache, it can be used directly. If the data is not in the application cache, it will request to obtain the data from the database or third-party data and put the data into the application cache. The data in the cache will be set with a cache expiration time starting from the last update time of the data. After the set cache expiration time, the expired data will be deleted from the cache.

[0029] Currently, a fixed cache expiration time is generally set based on research or development experience. However, this method cannot accurately estimate the update cycle of the current data, and cannot adapt to the dynamic changes of the data update cycle, resulting in the data in the cache lagging behind the data update. There is a situation where the data has been updated, but the data in the cache has not expired. In this case, the requested data is invalid data that has not been updated.

[0030] Based on this, the embodiment of the present application provides a data cache processing method, device and equipment, which analyzes the historical update cycle of the data source, and dynamically adjusts the cache expiration time of the target data according to the average update cycle of the target data. In this way, the cache expiration time is dynamically adjusted according to the data update cycle, making the setting of the cache expiration time more flexible and accurate, greatly reducing the situation where the data has been updated but invalid data that has not expired is obtained from the cache.

[0031] In order to facilitate understanding of the data cache processing method provided in the embodiment of the present application, Figure 1-2 See the example scenario shown in the figure. Figure 1 As shown, this figure is a schematic diagram of an exemplary application scenario of the system architecture provided in an embodiment of the present application.

[0032] The embodiment of the present application can be applied to a device for determining the cache expiration time, such as a server. The data cache processing method is applied to a server as an example for explanation. When a business caller, such as a client, needs to call data, it can send a request to the server to obtain data. The server can be divided into a data use module and a data providing module. The data providing module provides data services to the outside, and the data is stored in its own database. The data stored in the database can be updated according to actual conditions through a data update module in the data providing module. The data use module has a cache, and the data processing module in the data use module can respond to the client's request. If there is requested data in the cache, the data is directly returned to the business caller. If there is no requested data in the cache, the data use module queries and obtains the data from the data providing module through the data query module, returns the data to the business caller, and stores the data in the cache at the same time. When the data is stored in the cache, the cache expiration time of the data can be set, or, after the data is stored in the cache, the cache expiration time of the data can also be reset.

[0033] See also Figure 2 As shown, this figure is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.

[0034] The embodiment of the present application can determine the average update period according to the multiple update time intervals of the data provided in the data providing module within the preset time range. Then determine the volatility parameter of these update time intervals. If the volatility parameter is less than the threshold, it means that the update time interval of the data is not very volatile, that is, the update period is relatively stable, and the average update period can be determined as the update period of the target data. When it is necessary to set the cache expiration time of the target data, the cache expiration time of the data is determined according to the update period of the target data, the last update time of the target data, and the current time.

[0035] Since the cache expiration time of the data is dynamically determined according to the average update cycle, the setting of the cache expiration time of the data is more accurate.

[0036] Those skilled in the art will understand that Figure 1-2 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.

[0037] To facilitate understanding of the embodiments of the present application, a data cache processing method provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0038] See also Figure 3 As shown, this figure is a flow chart of a data cache processing method provided by an embodiment of the present application, such as Figure 3 As shown, the method may include S301-S304:

[0039] S301: Acquire multiple update time intervals of target data within a preset time range, and determine an average update period according to the multiple update time intervals.

[0040] A large amount of data is stored in the database, and each piece of data will be updated according to the actual situation. When it is necessary to determine the cache expiration time of a piece of data, for example, when the data needs to be put into the cache, the cache expiration time needs to be determined, and the data can be used as the target data. The target data is any piece of data stored in the database.

[0041] Each piece of data stored in the database may have information such as a unique identifier, a data entity, the latest update time, and a historical update time set. The historical update time set may include n update times of the data, where n is a positive integer and can be dynamically set according to actual conditions. Then, based on the historical update time set of the target data, multiple update time intervals of the target data within a preset time range may be obtained, and the update time interval may be understood as the interval between two adjacent update times. The preset time range may be set according to actual conditions, and the preset time range may be a fixed time range, such as a preset time range of 5 days, or the preset time range may also be determined based on multiple update times, such as a preset time range that is a time range generated by the most recent multiple update times.

[0042] The average update period of the target data can be determined based on the multiple update time intervals obtained. The average update period is the average value of the multiple update time intervals, which can be understood as how often the target data is updated on average.

[0043] In a possible implementation, S301 acquires multiple update time intervals of the target data within a preset time range, and specific implementation of determining the average update period according to the multiple update time intervals may include:

[0044] A1: Get the latest m update times of the target data within a preset time range, where m is a positive integer greater than 2.

[0045] A2: Calculate the difference between the adjacent update times in the most recent m update times to obtain m-1 update time intervals.

[0046] A3: Calculate the average of m-1 update time intervals to obtain the average update period.

[0047] The latest m consecutive update times of the target data within a preset time range are obtained from the historical update time set of the target data, where m is a positive integer greater than 2, m is less than or equal to n, and m can be dynamically set according to the actual situation. The difference between the two adjacent update times in the m update times is calculated to obtain m-1 update time intervals. That is, the i-th update time interval Tgap_i = Tup_i-Tup_i-1, where Tup_i is the i-th update time, Tup_i-1 is the i-1th update time, and i is a positive integer from 2 to m, and a total of m-1 update time intervals are obtained.

[0048] Finally, the average value of m-1 update time intervals is calculated to obtain the average update period of the target data, that is, the average update period Tavg = (Tgap_m + Tgap_m-1 + ... + Tgap_2) / (m-1), where Tgap_m...Tgap_2 is the mth update time interval to the 2nd update time interval, and m is the number of update time intervals.

[0049] S302: Determine volatility parameters of multiple update time intervals.

[0050] After obtaining the update time interval of the target data, the volatility of multiple update time intervals of the target data can be analyzed by using the volatility parameters of multiple update time intervals of the target data. The volatility parameter of the update time interval characterizes the volatility of the multiple update time intervals obtained, and the volatility parameter of the update time interval is positively correlated with the volatility of the update time interval. That is, if the volatility parameter of the update time interval is larger, it means that the volatility of the update time interval is larger, and if the volatility parameter of the update time interval is smaller, it means that the volatility of the update time interval is smaller.

[0051] The volatility parameter of the update time interval may be determined according to the standard deviation of the update time interval. In a possible implementation, the specific implementation of determining the volatility parameters of multiple update time intervals in S302 may include:

[0052] The standard deviation of multiple update time intervals is calculated and the standard deviation is determined as the volatility parameter of the update time interval.

[0053] When the update time interval distribution is relatively dispersed, that is, the update time interval fluctuates greatly around the average value of the update time interval, the sum of the squares of the differences between each update time interval and the average value of the update time interval is large, and the standard deviation obtained by taking the square root of the square sum is large. When the update time interval distribution is relatively concentrated, that is, the update time interval fluctuates less around the average value of the update time interval, the sum of the squares of the differences between each update time interval and the average value of the update time interval is small, and the standard deviation obtained by taking the square root of the square sum is small. Therefore, the standard deviation of the update time interval can be used as a volatility parameter of the update time interval. The larger the standard deviation, the greater the volatility of the update time interval, and the smaller the standard deviation, the smaller the volatility of the update time interval.

[0054] The formula for calculating the standard deviation of the update time interval is:

[0055]

[0056] Wherein, F is the standard deviation of the update time interval, m is the number of update time intervals, Tavg is the average update time period, and Tgap_m…Tgap_2 is the update time interval from the mth update time interval to the second update time interval.

[0057] The volatility of the update time interval can be analyzed by analyzing the standard deviation of multiple update time intervals.

[0058] In addition, the volatility parameter of the update time interval may also be other indicators such as the variance of multiple update time intervals.

[0059] S303: If the volatility parameter is less than the threshold, the average update period is determined as the update period of the target data.

[0060] If the volatility parameter is less than the threshold, it means that the volatility of the update time interval is small and the update cycle of the target data is relatively stable. Then the average update cycle of the target data can be determined as the update cycle of the target data for subsequent determination of the cache expiration time of the target data. The threshold can be dynamically adjusted according to the actual situation.

[0061] Each piece of data stored in the database also includes a data update validity flag and an update cycle. After the average update cycle is determined as the update cycle of the target data, the data update validity flag of the target data can be set to valid, and the update cycle of the target data can be saved in the database.

[0062] In a possible implementation, the threshold is the product of the average update period and the weight ratio.

[0063] In practical applications, the update cycle of the target data can be determined to be relatively stable by the volatility parameter being less than a threshold. The threshold can be the product of the average update cycle and the weight ratio, wherein the weight ratio can be dynamically adjusted according to actual conditions.

[0064] S304: In response to a request to set a cache expiration time of the target data, determine a cache expiration time of the target data according to an update cycle of the target data, a last update time of the target data, and a current time, where the cache expiration time is used to indicate an expiration time of the target data in the cache.

[0065] When it is necessary to set the cache expiration time of the target data, a cache expiration time setting request for the target data can be triggered. For example, when the target data is stored in the cache, after the target data is updated, or when the cache expiration time needs to be reset after the target data is stored in the cache, a cache expiration time setting request for the target data can be triggered. In response to the cache expiration time setting request, the current time (or system time) Tcurrent can be obtained, and then the most recent update time update_time of the target data and the update cycle Tavg of the target data determined in the above steps can be obtained. The cache expiration time of the target data can be calculated through these three parameters. After the target data is placed in the cache, the cache expiration time is used to indicate the expiration time of the target data in the cache. When the cache expiration time of the target data is exceeded, it means that the target data is invalid in the cache, and the target data should be deleted from the cache.

[0066] In a possible implementation, S304 determines, in response to a request to set a cache expiration time of the target data, a cache expiration time of the target data according to an update cycle of the target data, a last update time of the target data, and a current time, including:

[0067] B1: In response to a request to set a cache expiration time for target data, calculate the last update time of the target data plus and minus the current time to obtain the target result.

[0068] B2: If the target result is greater than 0, the target result is determined as the cache expiration time of the target data.

[0069] Target result Texp = update_time + Tavg - Tcurrent. If the target result is greater than 0, it means that the target data has not expired, and the target result is determined as the cache expiration time of the target data. For example, the target data was last updated at 12 o'clock, the update cycle of the target data is 10 minutes, the current time is 12:05, and the cache expiration time of the target data is 5 minutes, that is, the target data will expire in 5 minutes. In this way, the cache expiration time can be dynamically adjusted according to the update cycle of the target data, making the cache expiration time more accurate.

[0070] In a possible implementation, if the target result is less than or equal to 0, the cache expiration time of the target data is determined according to a default update cycle.

[0071] If the target result is less than or equal to 0, it means that the target data is currently expired, and the cache expiration time is set according to the default method. Specifically, the cache expiration time of the target data is determined according to the default update cycle. For example, if the default update cycle is 15 minutes, the cache expiration time of the target data is set to 15 minutes.

[0072] In a possible implementation, if the volatility parameter is greater than or equal to a threshold, in response to a request to set a cache expiration time of the target data, a cache expiration time of the target data is determined according to a default update cycle.

[0073] If the volatility parameter is greater than or equal to the threshold, it means that the volatility of the update time interval is large and the update cycle of the target data is unstable. It is not appropriate to use the update cycle of the target data to dynamically set the cache expiration time, and the cache expiration time is set in the default manner. Specifically, in response to the cache expiration time setting request for the target data, the cache expiration time of the target data is determined according to the default update cycle.

[0074] In the embodiment of the present application, when it is not appropriate to dynamically set the cache expiration time using an update cycle, the cache expiration time is set in a default manner, which ensures the integrity of the implementation and also prevents the cache expiration time from fluctuating too much.

[0075] In addition, in actual applications, since the cache expiration time is set more accurately, the data usage module can also obtain the latest updated data from the data provision module in a timely and proactive manner after the data expires, making the cache space used more reasonably and efficiently.

[0076] In this way, the embodiment of the present application determines an average update period based on multiple update time intervals of the target data within a preset time range, and further determines a volatility parameter of the multiple update time intervals. If the volatility parameter is less than a threshold value, it means that the update time interval of the target data is not very volatile, that is, the update period is relatively stable, and the average update period can be determined as the update period of the target data. When it is necessary to set the cache expiration time of the target data, the cache expiration time of the target data is determined based on the update period of the target data, the most recent update time of the target data, and the current time. In this way, the cache expiration time is dynamically determined based on the average update period, making the setting of the cache expiration time more flexible and accurate, and greatly reducing the situation where the data has been updated but invalid data that has not expired is obtained from the cache.

[0077] Based on a data cache processing method provided by the above method embodiment, an embodiment of the present application also provides a data cache processing device, which will be described below in conjunction with the accompanying drawings.

[0078] See also Figure 4 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a data cache processing device provided in an embodiment of the present application. Figure 4 As shown, the data cache processing device includes:

[0079] The first determining unit 401 is used to obtain multiple update time intervals of the target data within a preset time range, and determine an average update period according to the multiple update time intervals;

[0080] A second determining unit 402, configured to determine a plurality of volatility parameters of the update time intervals;

[0081] A third determining unit 403 is configured to determine the average update period as the update period of the target data if the volatility parameter is less than a threshold;

[0082] The fourth determination unit 404 is used to respond to a request to set a cache expiration time of the target data, and determine the cache expiration time of the target data according to an update cycle of the target data, a last update time of the target data, and a current time, wherein the cache expiration time is used to indicate an expiration time of the target data in the cache.

[0083] In a possible implementation manner, the first determining unit includes:

[0084] The acquisition subunit is used to obtain the latest m update times of the target data within a preset time range, where m is a positive integer greater than 2;

[0085] A first calculation subunit is used to calculate the difference between adjacent update times in the most recent m update times to obtain m-1 update time intervals;

[0086] The second calculation subunit is used to calculate the average value of the m-1 update time intervals to obtain an average update period.

[0087] In a possible implementation manner, the second determining unit is specifically configured to:

[0088] The standard deviation of a plurality of the update time intervals is calculated, and the standard deviation is determined as a volatility parameter of the update time interval.

[0089] In a possible implementation manner, the fourth determining unit includes:

[0090] A third determination subunit is used to calculate the last update time of the target data plus the update period of the target data, minus the current time, in response to the cache expiration time setting request of the target data, to obtain a target result;

[0091] A determination subunit is used to determine the target result as the cache expiration time of the target data if the target result is greater than 0.

[0092] In a possible implementation manner, the device further includes:

[0093] A sixth determining unit is configured to determine a cache expiration time of the target data according to a default update cycle if the target result is less than or equal to 0.

[0094] In a possible implementation manner, the device further includes:

[0095] A fifth determining unit is configured to determine a cache expiration time of the target data according to a default update cycle in response to a request to set a cache expiration time of the target data if the volatility parameter is greater than or equal to the threshold.

[0096] In a possible implementation manner, the threshold is a product of the average update period and a weight ratio.

[0097] Based on a data cache processing method provided in the above method embodiment, an embodiment of the present application also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the data cache processing method described in any of the above embodiments.

[0098] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 1300 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0099] like Figure 5As shown, the electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1306 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for the operation of the electronic device 1300 are also stored. The processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0100] Typically, the following devices may be connected to the I / O interface 1305: an input device 1306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1306 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1309. The communication device 1309 may allow the electronic device 1300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 1300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0101] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1309, or installed from the storage device 1306, or installed from the ROM 1302. When the computer program is executed by the processing device 1301, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0102] The electronic device provided in the embodiment of the present application and the data cache processing method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0103] Based on a data cache processing method provided in the above method embodiment, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the data cache processing method as described in any of the above embodiments is implemented.

[0104] It should be noted that the computer-readable medium in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0105] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0106] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0107] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the data cache processing method.

[0108] The computer program code for performing the operation of the embodiment of the present application can be written in one or more programming languages ​​or a combination thereof, and the above-mentioned programming languages ​​include but are not limited to object-oriented programming languages-such as Java, Smalltalk, C++, and also include conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.

[0111] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0112] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0113] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0114] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0115] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0116] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0117] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data cache processing method, characterized in that: The method comprises: Acquire multiple update time intervals of the target data within a preset time range, and determine an average update period according to the multiple update time intervals; determining a volatility parameter for a plurality of said update time intervals; If the volatility parameter is less than a threshold, determining the average update period as the update period of the target data; In response to a request to set a cache expiration time for the target data, the cache expiration time of the target data is determined according to an update cycle of the target data, a last update time of the target data and a current time, wherein the cache expiration time is used to indicate an expiration time of the target data in the cache.

2. The method according to claim 1, characterized in that: The acquiring of multiple update time intervals of the target data within a preset time range, and determining an average update period according to the multiple update time intervals, comprises: Get the latest m update times of the target data within a preset time range, where m is a positive integer greater than 2; Calculate the difference between adjacent update times in the most recent m update times to obtain m-1 update time intervals; The average value of the m-1 update time intervals is calculated to obtain an average update period.

3. The method according to claim 1, characterized in that The determining of the volatility parameters of the plurality of update time intervals comprises: The standard deviation of a plurality of the update time intervals is calculated, and the standard deviation is determined as a volatility parameter of the update time interval.

4. The method according to claim 1, characterized in that: The step of responding to the cache expiration time setting request for the target data and determining the cache expiration time of the target data according to the update cycle of the target data, the last update time of the target data, and the current time includes: In response to a request to set a cache expiration time of the target data, calculate the last update time of the target data plus the update period of the target data, minus the current time, to obtain a target result; If the target result is greater than 0, the target result is determined as the cache expiration time of the target data.

5. The method according to claim 4, characterized in that The method further comprises: If the target result is less than or equal to 0, the cache expiration time of the target data is determined according to a default update cycle.

6. The method according to claim 1, characterized in that The method further comprises: If the volatility parameter is greater than or equal to the threshold, in response to a request to set a cache expiration time of the target data, a cache expiration time of the target data is determined according to a default update cycle.

7. The method according to claim 1 or 6, characterized in that: The threshold is the product of the average update period and the weight ratio.

8. A data cache processing device, characterized in that: The device comprises: A first determining unit, configured to obtain a plurality of update time intervals of the target data within a preset time range, and determine an average update period according to the plurality of update time intervals; A second determining unit, configured to determine a volatility parameter of a plurality of said update time intervals; a third determining unit, configured to determine the average update period as the update period of the target data if the volatility parameter is less than a threshold; A fourth determination unit is used to respond to a request to set a cache expiration time of the target data, determine the cache expiration time of the target data according to an update cycle of the target data, a last update time of the target data and a current time, wherein the cache expiration time is used to indicate an expiration time of the target data in the cache.

9. A device for determining cache expiration time, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data cache processing method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on the terminal device, the terminal device executes the data cache processing method according to any one of claims 1 to 7.