Cache refresh method, device, equipment and medium based on user access habits

By setting a timed refresh mechanism and preset number of times in the cache of the terminal, and combining the user's access habits, the cache data is refreshed reasonably, which solves the problem of improper cache expiration time setting and improves the freshness and hit rate of the cache.

CN115098808BActive Publication Date: 2025-09-16PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210731976.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-26
Publication Date
2025-09-16
Estimated Expiration
2042-06-26

AI Technical Summary

Technical Problem

In the prior art, improper setting of the expiration time of cached data results in the inability of the cache to update itself. If the expiration time is too long, the data cannot be updated. If the expiration time is too short, the cache hit rate cannot be improved and the cache efficiency is low.

Method used

By responding to the timed refresh instruction, the cache in the terminal is refreshed every first preset time interval, and it is determined whether the number of times the cache data is obtained within the most recent first preset time interval exceeds the preset number. If it exceeds, it is refreshed; otherwise, the current cache is retained until it is refreshed again after another first preset time interval.

Benefits of technology

The cache is refreshed at a reasonable time and frequency, taking into account the freshness and hit rate of the cached data, and avoiding the situation where the cache is refreshed too quickly or too slowly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098808B_ABST
    Figure CN115098808B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a cache refresh method, apparatus, device, and medium based on user access habits. The method includes: refreshing the cache in a terminal in response to a timed refresh instruction, wherein the cache in the terminal is refreshed once every first preset time interval; determining whether the number of times cached data has been retrieved within the most recent first preset time interval exceeds a preset number; if so, refreshing the cache in the terminal; if not, retaining the current cache in the terminal until it is refreshed again after another interval of the first preset time interval. The method of the embodiments of the present application can refresh the cache at a reasonable time and refresh frequency, avoiding situations where the cache refresh is too fast or too slow, and taking into account the freshness and hit rate of the cached data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a cache refresh method, apparatus, computer equipment, and storage medium based on user access habits. Background Art

[0002] With the development of the internet and the widespread adoption of computer technology, most computer systems utilize caches to improve the efficiency of data loading between computers. This allows for direct access to data when needed, alleviating the pressure on backend resources and increasing data loading speed. To increase access speed and reduce access pressure on cached data, cached data is typically stored on high-performance storage media.

[0003] However, data stored in high-performance storage media cannot be updated autonomously and can only be passively updated by setting an expiration time and then replacing a batch of cached data by means of cache refresh after the expiration time is reached.

[0004] Therefore, if the expiration time is set too long, the data cannot be updated. If the expiration time is set too short, the cache hit rate cannot be improved and the cache itself is not efficient. Summary of the Invention

[0005] The embodiments of the present application provide a cache refresh method, apparatus, device, and medium based on user access habits, which can refresh the cache at a reasonable time and refresh frequency to take into account the freshness and hit rate of the cached data.

[0006] The present invention provides a method for refreshing a cache based on user access habits, including:

[0007] Refreshing a cache in the terminal in response to a timed refresh instruction, wherein the cache in the terminal is refreshed once every first preset time interval;

[0008] Determine whether the number of times the cached data is obtained within the most recent first preset time period exceeds a preset number;

[0009] If so, refreshing the cache in the terminal;

[0010] If not, the current cache in the terminal is retained until it is refreshed again after the first preset time interval.

[0011] The embodiment of the present application further provides a cache refresh device based on user access habits, including:

[0012] A first cache refresh module, in response to a timed refresh instruction, configured to refresh a cache in the terminal, wherein the cache in the terminal is refreshed once every first preset time interval;

[0013] A cache determination module is used to determine whether the number of times cache data is obtained within the most recent first preset time period exceeds a preset number;

[0014] a second cache refresh module, if yes, for refreshing the cache in the terminal;

[0015] The third cache refresh module is used to retain the current cache in the terminal if no, until refreshing again after the first preset time interval.

[0016] An embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the cache refresh method based on user access habits is implemented.

[0017] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned cache refresh method based on user access habits.

[0018] In an embodiment of the present application, the cache in the terminal can be refreshed in response to a timed refresh instruction, wherein the cache in the terminal is refreshed once every first preset time interval; it is determined whether the number of times cached data is obtained within the most recent first preset time interval exceeds a preset number; if so, the cache in the terminal is refreshed; if not, the current cache in the terminal is retained until it is refreshed again after another interval of the first preset time interval.

[0019] The beneficial effect of the present application is that the embodiment of the present application accurately determines the first preset duration and the preset number of times through the user's behavior and habits of accessing the page, and combines the first preset duration and the preset number of times as conditions for forcing a cache refresh, thereby enabling the cache to be refreshed at a reasonable time and refresh frequency, avoiding the situation where the cache is refreshed too fast or too slow, and taking into account the freshness and hit rate of the cached data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a scenario diagram of a cache refresh method based on user access habits provided by an embodiment of the present application;

[0022] Figure 2 This is a flow chart of a cache refresh method based on user access habits provided by an embodiment of the present application;

[0023] Figure 3 This is another flowchart of a cache refresh method based on user access habits provided by an embodiment of the present application;

[0024] Figure 4 Schematic diagram of the structure of a cache refresh device based on user access habits provided by an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of a computer device provided in an embodiment of the present application;

[0026] Figure 6 It is a structural diagram of the storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0028] The terms "first," "second," and "third" in this application are used only for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of such features. In the description of this application, "multiple" means at least two, for example, two, three, etc., unless otherwise specifically defined. All directional indications in the embodiments of this application (such as up, down, left, right, front, back...) are only used to explain the relative positional relationship, movement, etc. between the components under a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications also change accordingly. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products, or devices.

[0029] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0030] Please refer to Figure 1 , Figure 1 A scenario diagram of a cache refresh method based on user access habits provided in an embodiment of the present application. The cache refresh method based on user access habits can be used in a server or a user, for example, obtaining a time series reflecting the driving status information of a vehicle through a terminal, and processing the time series reflecting the driving status information of the vehicle through a server. The terminal can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device; the server can be an independent server, a server cluster, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0031] like Figure 2 As shown, a cache refresh method based on user access habits is provided, which is applied in Figure 1 The server in the example is used as an example to illustrate the specific steps:

[0032] Step 101: Refresh the cache in the terminal in response to a timed refresh instruction.

[0033] The cache in the terminal is refreshed every first preset time interval. Taking the scenario of a user browsing a web page as an example, since the cached data is generated after the user first visits a web page, the web page can only be quickly loaded through the cached data after the user subsequently visits the web page again or multiple times.

[0034] It is understandable that as users' habits and preferences for accessing pages change, cached data needs to be updated to ensure its timeliness and hit accuracy. For example, a user may have visited multiple pages both the day before and today, but some of the pages from the previous day may be different from those from today, making the cached data from the previous day unable to meet the user's current needs. Therefore, an expiration time is usually set to force the refresh of cached data, which is equivalent to forcibly updating a new batch of cached data in the storage medium of the server or user terminal to ensure the freshness and hit rate of the cached data.

[0035] It is understood that the first preset duration is equivalent to the expiration time mentioned above. Optionally, the first preset duration can be set according to user needs, for example, the first preset duration can be 1 minute, 2 minutes, 1 hour, etc. For example, the cache in the terminal can be refreshed every 1 minute to achieve regular forced refresh of the cached data, thereby effectively ensuring the freshness and timeliness of the cached data.

[0036] Before step 101, the method of the embodiment of the present application may further include: determining the first preset duration.

[0037] Alternatively, as Figure 3 As shown, the step of “determining the first preset duration” may include the following steps:

[0038] Step 201: Obtain a first preset number of times, where the first preset number of times is used to represent the number of refreshes corresponding to consecutive page refresh operations in a target user's historical page access operations.

[0039] In some scenarios, users may refresh pages continuously while accessing them. For example, if a user is currently accessing their June billing page and wants to browse the page for their July billing page, they will refresh the page. The system may use cached data from the June billing page to quickly load the June billing page. However, the July billing page loads slower than the June billing page, causing the user to frequently refresh the page within a short period of time.

[0040] The first preset number of times refers to the number of times the user refreshes the page continuously, such as 2, 3, 4, etc. It is understood that when a page is refreshed continuously, it indicates that the user may be dissatisfied with the freshness or hit rate of the current cached data. Therefore, the user's behavior habits when accessing the page can be obtained by recording the first preset number of times, and the freshness of the cached data can be analyzed based on data such as the time, frequency, and number of occurrences of the first preset number of times.

[0041] Step 202: In response to the target user's access operation on the first page, record the first access time.

[0042] The first access moment is the moment when the target user refreshes the first page for the first preset number of times during the access operation.

[0043] According to the description in step 201, when the user refreshes the page continuously for a first preset number of times, it means that the user perceives that the current cached data is not fresh, so that the server can use this point as the basis for forcibly refreshing the cached data. Therefore, the length of time that the user usually perceives that the cached data is not fresh can be calculated by recording the first access time.

[0044] Step 203: Obtain a first difference between the first access time and the first access time, and record the duration corresponding to the first difference as a first duration.

[0045] The first access time is the time when the target user first accesses the page. It is understood that after obtaining the first access time and the first access time, the first duration can be accurately calculated. For example, if the first access time is 3:00 and the first access time is 3:01, the first duration can be 1 minute.

[0046] Accordingly, when a target user accesses a page, they may repeatedly refresh the page, resulting in multiple first access times. By obtaining multiple first access times, we can effectively obtain the duration between two adjacent first access times. For example, if the next first access time is 3:03, this indicates that the next time the user continuously refreshes the page, the duration between the previous continuous refresh is 2 minutes, meaning that the user perceives the cached data as stale again after 2 minutes.

[0047] Optionally, the method of the embodiment of the present application may further include the following steps:

[0048] Acquire a duration set, where the duration set includes multiple first durations generated by the target user in multiple page access operations;

[0049] Taking all data in the duration set as an object, calculating the average duration corresponding to the average value of the duration set;

[0050] According to the duration, all data in the duration set are arranged in ascending or descending order, the median duration corresponding to the median of the duration set is obtained, and the average duration or the median duration is used as the first preset duration.

[0051] It can be understood that the first duration is used to characterize the first continuous refresh operation of the target user, or the duration between the next continuous refresh operation and the last continuous refresh operation, so that the system can use the first duration as the basis for the target user to perceive that the data is not fresh, that is, use the first duration as the basis for determining the setting of the first preset duration.

[0052] Specifically, after obtaining multiple first durations, an average or median of the multiple first durations can be calculated, and the calculated average or median duration can be used as the first preset duration. Because the first duration corresponding to the average or median is more representative of the user's page access habits than the first duration of discrete samples, this calculation method can ensure the rationality of the determination of the first preset duration.

[0053] Step 102: Determine whether the number of times the cached data is obtained within the most recent first preset time period exceeds a preset number.

[0054] The preset number of times may be equal to the first preset number mentioned in step 101, ie, the number of times the user continuously refreshes the page.

[0055] Optionally, before step 102, the method may further include: determining the preset number of times.

[0056] Optionally, the step of “determining the preset number of times” may further include:

[0057] Acquire a first preset number set, where the preset number set includes a plurality of first preset numbers generated by the target user in multiple page access operations;

[0058] Taking all data in the preset number set as an object, calculating an average first preset number set corresponding to the average value of the preset number set;

[0059] According to the size of the preset number set, all data in the first preset number set are arranged in ascending or descending order, the median first preset number corresponding to the median of the first preset number set is obtained, and the average first preset number or the median first preset number is used as the preset number.

[0060] It is understood that, similar to determining the first preset duration, the preset number of times can be determined based on multiple first preset numbers in the first preset number set. Because the first preset number corresponding to the average or median is more able to reflect the user's page access habits than the first preset number of discrete samples, this method of determining the preset number can ensure the rationality of determining the preset number of times.

[0061] Step 103: If yes, refresh the cache in the terminal.

[0062] Step 104: If not, retain the current cache in the terminal until refreshing again after the first preset time interval.

[0063] It can be understood that the preset duration in the embodiment of the present application is equivalent to the expiration time of the current cached data, and the preset number of times is equivalent to the cache hit number of the cached data.

[0064] In some scenarios, when the target user does not perform continuous refresh operations, it is likely that the target user is browsing a page of interest and the current cached data is fresh enough, so it is only necessary to wait for the preset interval to perform a cache refresh operation. However, within the preset interval, if the target user performs continuous page refresh operations, and the number of refreshes corresponding to these continuous page refresh operations is greater than the preset number, it means that the target user is dissatisfied with the loading speed or content of the current page. The target user perceives that the current cached data is not fresh. To improve the efficiency and effectiveness of cached data refresh, the cache refresh operation can be performed without waiting for the preset interval to expire.

[0065] From the above, it can be seen that the embodiment of the present application accurately determines the first preset time length and the preset number of times through the user's behavior and habits of accessing the page, and combines the first preset time length and the preset number of times as conditions for forcing the cache to be refreshed, thereby enabling the cache to be refreshed at a reasonable time and refresh frequency, avoiding the situation where the cache is refreshed too fast or too slow, and taking into account the freshness and hit rate of the cached data.

[0066] Optionally, the method of the embodiment of the present application may further include the following steps:

[0067] During the time when the target user performs the page access operation, for a first refresh number of any page, detecting whether the first refresh number is less than the preset number;

[0068] If so, a first message is sent to the target user to prompt the user to perform a page refresh operation.

[0069] In some scenarios, when a user accesses a page, even if they are not interested in the content of the page or are dissatisfied with the loading speed of the page, they may not perform any page refresh operations. For example, the user forgets to perform the page refresh operation while processing other tasks. Therefore, in order to effectively and accurately obtain the first preset duration and the first preset number of times, a first message prompting the target user to perform a page refresh operation can be sent to the target user when it is detected that the target user has refreshed the page for too many hours. For example, a text message, voice message, or animation message prompting the target user to refresh the page can be sent to the target user in the form of a pop-up window or bullet screen.

[0070] In order to better implement the above method, the embodiment of the present application also provides a cache refresh device based on user access habits, which corresponds one-to-one with the cache refresh method based on user access habits in the above embodiment. Figure 4As shown, the cache refresh device based on user access habits is applied to a medical image processing model, which includes a saliency prediction sub-model, an attribution prediction sub-model, and a decision sub-model. The device includes a first cache refresh module 301, a cache judgment module 302, a second cache refresh module 303, and a third cache refresh module 304. The functional modules are described in detail as follows:

[0071] A first cache refresh module 301 is configured to refresh a cache in a terminal in response to a timed refresh instruction, wherein the cache in the terminal is refreshed once every first preset time interval;

[0072] The cache determination module 302 is used to determine whether the number of cache data acquisitions within the most recent first preset time period exceeds a preset number;

[0073] The second cache refresh module 303, if yes, is used to refresh the cache in the terminal;

[0074] If not, the third cache refresh module 304 is used to retain the current cache in the terminal until refreshing again after the first preset time interval.

[0075] Optionally, the cache refresh device based on user access habits may further include: a first preset time length determination module, configured to determine the first preset time length.

[0076] Optionally, the first preset duration determination module is specifically configured to:

[0077] Obtaining a first preset number of times, where the first preset number of times is used to represent the number of refreshes corresponding to consecutive page refresh operations by the target user in historical page access operations;

[0078] In response to an access operation of the target user on the first page, recording a first access time, wherein the first access time is a time when the target user refreshes the first page for the first preset number of times during the access operation;

[0079] A first difference between the first access time and the first access time is obtained, and a duration corresponding to the first difference is recorded as a first duration, wherein the first access time is the time when the target user first performs a page access operation.

[0080] Optionally, the first preset duration determining module may further include:

[0081] A duration set acquisition submodule, configured to acquire a duration set, wherein the duration set includes a plurality of first durations generated by the target user in multiple page access operations;

[0082] The average duration calculation submodule calculates the average duration corresponding to the average value of the duration set based on all data in the duration set;

[0083] The first preset duration calculation submodule is used to arrange all the data in the duration set in ascending or descending order according to the duration size, obtain the median duration corresponding to the median of the duration set, and use the average duration or the median duration as the first preset duration.

[0084] Optionally, the cache refresh device based on user access habits may further include: a preset number determination module, configured to determine the preset number of times.

[0085] Optionally, the preset number determination module is specifically configured to:

[0086] Acquire a first preset number set, where the preset number set includes a plurality of first preset numbers generated by the target user in multiple page access operations;

[0087] Taking all data in the preset number set as an object, calculating an average first preset number set corresponding to the average value of the preset number set;

[0088] According to the size of the preset number set, all data in the first preset number set are arranged in ascending or descending order, the median first preset number corresponding to the median of the first preset number set is obtained, and the average first preset number or the median first preset number is used as the preset number.

[0089] Optionally, the preset number determination module further includes:

[0090] a refresh count detection submodule, configured to detect, for a first refresh count of any page during the target user's execution of the page access operation, whether the first refresh count is less than the preset count;

[0091] The first information sending submodule is used to send a first message to the target user to prompt the user to perform a page refresh operation.

[0092] The specific definition of the cache refresh device based on user access habits can be found in the definition of the cache refresh method based on user access habits above, and will not be repeated here. Each module in the above-mentioned cache refresh device based on user access habits can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.

[0093] Thus, in this embodiment of the present application, a medical image can be input into a trained medical image processing model. This model first generates a fusion image of the corresponding saliency image and attribution map. Based on the fusion map, a score attribution map corresponding to the medical image is then output, thereby obtaining the health status and score represented by the medical image. This processing allows for a deeper interpretation of the representation information of the target area in the medical image, thereby improving the efficiency and effectiveness of medical image recognition.

[0094] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data generated or obtained during the cache refresh method based on user access habits, for example, to store medical image processing models, etc. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a cache refresh method based on user access habits is implemented.

[0095] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the cache refresh method based on user access habits in the above embodiment are implemented, for example, Figure 2 Alternatively, when the computer program is executed by a processor, the functions of each module in the cache refresh device based on user access habits in the above embodiment are realized, for example, Figure 4 The functions of modules 301 to 304 are shown in FIG. 3 and will not be described again in detail to avoid repetition.

[0096] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the cache refresh method based on user access habits in the above method embodiment is implemented. For example, Figure 2 Alternatively, when the computer program is executed by a processor, the functions of each module in the cache refresh device based on user access habits in the above embodiment are realized, for example, Figure 4 The functions of modules 301 to 304 are shown in FIG. 3 and will not be described again in detail to avoid repetition.

[0097] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0098] See Figure 6 , Figure 6 Schematic diagram of the structure of the storage medium of an embodiment of the present invention. The storage medium of the embodiment of the present invention stores program instructions 61 that can implement all the above methods, wherein the program instructions 61 can be stored in the above storage medium in the form of a software product, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a computer device such as a computer, a server, a mobile phone, or a tablet.

[0099] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0100] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A cache refresh method based on user access habits, characterized in that: The method comprises: Obtaining a first preset number of times, where the first preset number of times is used to represent the number of refreshes corresponding to consecutive page refresh operations by the target user in historical page access operations; In response to an access operation of the target user on the first page, recording a first access time, wherein the first access time is a time when the target user refreshes the first page for the first preset number of times during the access operation; Obtaining a first difference between the first access time and the first access time, and recording a duration corresponding to the first difference as a first duration, wherein the first access time is the time when the target user first performs a page access operation; Acquire a duration set, where the duration set includes multiple first durations generated by the target user in multiple page access operations; Taking all data in the duration set as an object, calculating the average duration corresponding to the average value of the duration set; Arrange all data in the duration set in ascending or descending order according to the duration, obtain the median duration corresponding to the median of the duration set, and use the average duration or the median duration as the first preset duration; Refreshing the cache in the terminal in response to the timed refresh instruction, wherein the cache in the terminal is refreshed once every first preset time interval; Determine whether the number of times the cached data is obtained within the most recent first preset time period exceeds a preset number; If so, refreshing the cache in the terminal; If not, the current cache in the terminal is retained until it is refreshed again after the first preset time interval.

2. The cache refresh method based on user access habits according to claim 1, characterized in that: Before determining whether the number of times the cached data is acquired within the most recent first preset time period exceeds a preset number, the method further includes: determining the preset number.

3. The cache refresh method based on user access habits according to claim 2, characterized in that: The determining the preset number of times includes: Obtaining a first preset number set, the preset number set including a plurality of first preset numbers generated by a target user in multiple page access operations; Taking all data in the preset number set as an object, calculating an average first preset number set corresponding to the average value of the preset number set; According to the size of the preset number set, all data in the first preset number set are arranged in ascending or descending order, the median first preset number corresponding to the median of the first preset number set is obtained, and the average first preset number or the median first preset number is used as the preset number.

4. The cache refresh method based on user access habits according to claim 1, characterized in that: The method further comprises: During the time when the target user performs the page access operation, for a first refresh number of any page, detecting whether the first refresh number is less than the preset number; If so, a first message is sent to the target user to prompt the target user to perform a page refresh operation.

5. A cache data refresh device based on user access habits, characterized in that: The device is used to execute the cache refresh method based on user access habits according to any one of claims 1 to 4, comprising: A first cache refresh module, in response to a timed refresh instruction, configured to refresh a cache in the terminal, wherein the cache in the terminal is refreshed once every first preset time interval; A cache determination module is used to determine whether the number of times cache data is obtained within the most recent first preset time period exceeds a preset number; a second cache refresh module, if yes, for refreshing the cache in the terminal; The third cache refresh module is used to retain the current cache in the terminal if no, until refreshing again after the first preset time interval.

6. A computer device comprising 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 cache refresh method based on user access habits as described in any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cache refresh method based on user access habits as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Data processing method and device, server and inventory system

    CN108334505A

  • Data caching method, device and equipment based on user behaviors and storage medium

    CN113360803A