Cache data processing method, device, computer equipment and storage medium

By using index values ​​and misses in the cache system of smart terminals to determine whether network files are added to the cache, and dynamically manage cache space, the problem of low cache hit rate in traditional cache systems is solved, and more efficient data is achieved Store and retrieve.

CN109815425BActive Publication Date: 2024-12-06PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811532285.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-14
Publication Date
2024-12-06
Estimated Expiration
2038-12-14

AI Technical Summary

Technical Problem

The cache system of traditional smart terminals has the problem of low cache hit rate, because newly stored objects are not necessarily frequently used objects, resulting in a low cache hit rate in actual use.

Method used

By obtaining the request for network files, determine its index value, and find out whether it exists in the cache entry table. If the number of misses reaches the threshold, add the file to the local cache, and update the file's reading frequency, dynamically manage the cache space to Ensure that frequently used data is in the cache.

Benefits of technology

Improve the cache hit rate, ensure that the data stored in the cache is frequently required data, and improves the efficiency and performance of information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109815425B_ABST
    Figure CN109815425B_ABST
Patent Text Reader

Abstract

The present application relates to a cache data processing method, device, computer equipment and storage medium. It relates to the field of data caching. The method comprises: obtaining a network file acquisition request, wherein the request carries a resource uniform locator of the network file; determining the index value of the network file according to the resource uniform locator; obtaining a cache entry table, and finding whether the index value of the network file is recorded in the cache entry table; if not, increasing the number of misses corresponding to the index value by 1 in the miss file list; when the number of misses corresponding to the index value is greater than a first threshold, adding the network file obtained from the network server to the local cache, and adding the index value of the network file to the cache entry table. The use of this method can improve the cache hit rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the continuous development of intelligent technology, more and more intelligent terminals are entering people's daily work and life. Users can exchange information with other users through intelligent terminals, and can also obtain some information such as text, video or pictures from the Internet through intelligent terminals. In order to obtain information more quickly, cache technology has emerged. Caching technology is to store the network data that users have browsed locally on the terminal, and when the data is requested again, it can be directly and quickly obtained from the cache.

[0003] The traditional cache system based on smart terminals implements the following cache method: when the smart terminal wants to read data, it first searches for the required data in the cache. If the data cannot be found, it obtains the required data according to the existing path and directly stores the obtained data in the cache. That is, once it is found that the required data is not found in the cache, the object file is directly written into the cache. The above traditional cache method may result in the newly stored objects not necessarily being frequently used objects, resulting in a low cache hit rate. Summary of the invention

[0004] Based on this, it is necessary to provide a cache data processing method, device, computer equipment and storage medium that can improve the cache hit rate in response to the above technical problems.

[0005] A cache data processing method, the method comprising:

[0006] Obtain a network file acquisition request, wherein the request carries a resource uniform locator of the network file;

[0007] Determine the index value of the network file according to the resource uniform locator;

[0008] Obtaining a cache entry table, and searching whether the index value of the network file is recorded in the cache entry table;

[0009] If not, the number of misses corresponding to the index value in the miss file list is increased by 1;

[0010] When the number of misses corresponding to the index value is greater than a first threshold, the network file obtained from the network server is added to the local cache, and the index value of the network file is added to the cache entry table.

[0011] In one embodiment, the method further comprises:

[0012] If the index value of the network file is recorded in the cache entry table, obtaining the network file from the local cache;

[0013] The file reading frequency corresponding to the index value of the network file in the cache entry table is updated.

[0014] In one embodiment, when the number of misses corresponding to the index value is greater than a first threshold, adding the network file obtained from the network server to the local cache, and adding the index value of the network file to the cache entry table, includes:

[0015] If the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold, comparing the remaining space in the local cache with the file size of the network file currently requested;

[0016] If the local cache space is smaller than the file size of the network file, obtaining a target index value of the file read frequency less than a set threshold from the cache entry table;

[0017] Deleting the network file corresponding to the target index value from the local cache, and deleting the target index value from the cache entry;

[0018] The network file currently requested is added to the local cache, and the index value of the network file currently requested is added to the cache entry table.

[0019] In one embodiment, adding the index value of the network file currently requested to the cache entry table includes:

[0020] Calculate the average file read frequency of all the file read frequencies in the cache entry table;

[0021] Adding the index value of the network file currently requested to the cache entry table, and setting the file reading frequency corresponding to the newly added index value to the average file reading frequency;

[0022] In the missed file list, the number of missed times corresponding to the index value of the network file currently requested is set to 0.

[0023] In one embodiment, the method further comprises:

[0024] The remaining space of the local cache is obtained in real time. If the remaining space of the local cache is greater than a set threshold, the network files corresponding to the index values ​​whose number of misses is greater than a second threshold in the miss file list are added to the local cache, wherein the second threshold is less than the first threshold.

[0025] A cache data processing device, the device comprising:

[0026] A request acquisition module, used to acquire a network file acquisition request, wherein the request carries a resource uniform locator of the network file;

[0027] An index value calculation module, used to determine the index value of the network file according to the resource uniform locator;

[0028] A cache search module, used to obtain a cache entry table, and to search whether the index value of the network file is recorded in the cache entry table. If not, the number of misses corresponding to the index value is increased by 1 in the miss file list;

[0029] The cache module is used to add the network file obtained from the network server to the local cache and add the index value of the network file to the cache entry table when the number of misses corresponding to the index value is greater than a first threshold.

[0030] In one embodiment, the apparatus further comprises:

[0031] A network file acquisition module, configured to acquire the network file from the local cache if the index value of the network file is recorded in the cache entry table;

[0032] The file reading frequency updating module is used to update the file reading frequency corresponding to the index value of the network file in the cache entry table.

[0033] In one embodiment, the cache module is also used to compare the remaining space in the local cache with the file size of the network file currently requested if the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold; if the local cache space is smaller than the file size of the network file, obtain the target index value of the file read frequency less than a set threshold from the cache entry table; delete the network file corresponding to the target index value from the local cache, and delete the target index value from the cache entry; add the network file currently requested to the local cache, and add the index value of the network file currently requested to the cache entry table.

[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0035] A computer-readable storage medium stores a computer program, which implements the steps of the method described above when executed by a processor.

[0036] The cache data processing method, device, computer equipment and storage medium correspond to a unique resource unified locator for network files, and then generate an index value corresponding to each network file through the resource unified locator, and then generate a cache entry table and a miss file list based on the index value. The cache entry table can quickly determine whether the network file to be read is in the local cache, and the number of misses in the miss file list is used as a criterion for determining whether the network file is added to the local cache. Only when the number of misses of the network file reaches a set threshold, the network file is added to the local cache, ensuring that the data added to the cache are frequently required data, and the cache hit rate is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 An application scenario diagram of a cache data processing method in an embodiment;

[0038] Figure 2 A schematic diagram of a flow chart of a cache data processing method in one embodiment;

[0039] Figure 3 It is a flowchart of a cache data processing method in another embodiment;

[0040] Figure 4 A cache principle diagram involved in a cache data processing method in one embodiment;

[0041] Figure 5 It is a structural block diagram of a cache data processing device in one embodiment;

[0042] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The cache data processing method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the network server 104 through the network. The terminal 102 listens to the network file acquisition request of the application program and searches whether there is a requested network file in the local cache; when the terminal cache does not have the required network file, the terminal 102 sends a network file acquisition request to the network server 104, and returns the network server to the application program, and the terminal determines whether the network file is written into the cache based on the number of misses of the network file. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0045] In one embodiment, Figure 2 As shown, a cache data processing method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0046] Step 202: Obtain a network file acquisition request, which carries a resource uniform locator of the network file.

[0047] The terminal monitors the user's operation instructions to the application. When the user clicks on a page link in the page, a network file acquisition request is triggered, and the terminal obtains the uniform resource locator corresponding to the triggered link. The uniform resource locator (URL) is a unique network identifier for each file on the network. The URL includes the resource location and access method on the Internet. For example, the corresponding file resource can be obtained from the network through the URL.

[0048] Step 204: determine the index value of the network file according to the resource uniform locator.

[0049] The uniform resource locator has a fixed information format. The uniform resource locator is processed by a preset algorithm to obtain an output, which is the index value of the corresponding network file. The index values ​​determined based on different uniform resource locators are different. Therefore, each network file corresponds to a unique uniform resource locator, and each uniform resource locator corresponds to a unique index value. Therefore, the network file and the index value also have a unique corresponding relationship, and one index value corresponds to a fixed network file.

[0050] In one embodiment, the resource uniform locator can be processed by a hash algorithm, and the obtained hash value is the index value. It should be noted that when the resource uniform locators of different network files are hashed and the same hash value is obtained, other algorithms are used to distinguish the obtained same hash values.

[0051] In one embodiment, the index values ​​of all network files are determined in advance based on the uniform resource locator. If there are network files with the same index value, the files with the same index value are distinguished by a differentiation algorithm. Ultimately, it is ensured that each index value corresponds to a unique network file. When a network file acquisition request is obtained, the index value corresponding to the network file is directly searched.

[0052] Step 206: Obtain the cache entry table and check whether the index value of the network file is recorded in the cache entry table.

[0053] The local cache caches network files, and the cache entry table records the index values ​​of all cached network files in the local cache. Further, the cache entry table may also include file information of each cached network file, such as the URL of the network file, the file type, the number of bytes occupied by the file, etc.

[0054] The terminal obtains the cache entry table and searches whether the index value of the network file to be read is recorded in the cache entry table. If so, the network file to be read is already cached locally, and the terminal directly obtains the network file from the cache. If the index value of the network file to be read is not hit by the cache entry table, the network file to be read is not cached.

[0055] Step 208: If not, the number of misses corresponding to the index value of the network file in the miss file list is increased by 1.

[0056] If the network file to be read is not in the local cache, a list of missed files is obtained. The missed file list records the number of missed files. The network file to be read is not in the local cache, that is, the network file to be read is not hit by the local cache. At this time, in the missed list, the number of missed corresponding to the index value of the network file to be read is increased by 1.

[0057] If the network file is not hit by the cache entry, the terminal sends a network file acquisition request to the network server, and the request carries the uniform resource locator of the network file. The network server searches for the network file according to the uniform resource locator and returns the network file to the terminal.

[0058] Furthermore, if the index value corresponding to the network file to be read does not exist in the missed file list, the index value corresponding to the network file to be read is added to the missed file list, and the number of misses corresponding to the index value in the missed file list is set to 1. The missed file list should include as many index values ​​as possible so as to record the miss situations of the network files corresponding to the index values. The missed file list may also include the index values ​​in the cache entry table. The number of misses corresponding to the index values ​​in the cache entry table in the missed file list is 0. When the index value is evicted from the cache entry table, the miss list records the miss situations of the evicted index value.

[0059] Step 210: When the number of misses corresponding to the index value of the network file is greater than a first threshold, the network file obtained from the network server is added to the local cache, and the index value of the network file is added to the cache entry table.

[0060] After the number of misses corresponding to the index value of the network file increases by 1, it is determined whether the number of misses is greater than the first threshold. If so, the network file obtained from the network server is added to the local cache, and accordingly, the index value of the network file is increased in the cache entry table.

[0061] In this embodiment, the number of misses is used as a criterion for determining whether to add a file to the cache. Only network files that have not been hit in the cache for multiple times are added to the cache, so that the most demanded objects are stored in a limited cache space, thereby improving the cache hit rate.

[0062] In one embodiment, in step 206, after obtaining the cache entry table and searching whether the index value of the network file is recorded in the cache entry table, the method further includes: if the index value of the target network file is in the cache entry list, obtaining the network file corresponding to the index value from the local cache, and returning the network file to the requesting application. At the same time, the terminal also updates the file reading frequency corresponding to the index value of the target network file in the cache entry table.

[0063] The file read frequency represents how frequently the files in the cache are requested. The higher the file read frequency, the more frequently the corresponding network file is requested.

[0064] In one embodiment, the number of file reads is the number of file reads in a set time interval. The set time interval can be one hour, several hours, one day, etc. That is, for each time interval period, the number of file reads corresponding to all index values ​​in the cache entry table is re-recorded. After the current time period ends, the number of file reads corresponding to all index values ​​in all cache entry tables in the current time period is obtained, and the number of file reads is used as the latest data until the next time period ends, and the number of file reads recorded in the next time period is used as the latest data. That is, the file read frequency is the number of file reads in the most recent time period.

[0065] In another embodiment, the number of file reads is the average number of file reads in multiple set time intervals. The multiple set time intervals are update frequencies of the file reads. The number of file reads corresponding to each index value in the cache entry table is re-recorded every other time interval, and the average number of file reads in multiple time intervals is calculated every other update frequency, and the average number is used as the latest number of file reads corresponding to the index value.

[0066] For example, the time period is 1 hour and the update frequency is 2 hours. Take the number of file reads corresponding to any index value in the cache entry table as an example. The number of file reads for index value A that was most recently updated at 12:00 is 10. Starting from 12:00, the number of network file reads corresponding to index value A is recorded. Assuming that the number of reads from 12:00 to 13:00 is 15, and the number of reads from 13:00 to 14:00 is 25, the average number of file reads from 12:00 to 14:00 is calculated at 14:00 as (15+25) / 2=20, where 20 is the latest number of file reads for index value A, that is, the file read frequency.

[0067] In one embodiment, Figure 3 As shown, a cache data processing method is provided, which specifically includes the following steps:

[0068] Step 302, obtaining the index value of the target network file. If the index value of the target network file is not recorded in the cache entry table, the network file is obtained from the network server.

[0069] Step 304 , obtaining a list of missed files, and checking whether the list of missed files contains the index value of the target network file, if not, executing step 306 , if yes, executing step 308 .

[0070] Step 306: Add the index value of the target network file to the missed file list, and record the number of missed times corresponding to the index value of the target network file as 1.

[0071] Step 308: Increase the number of misses corresponding to the index value of the target network file in the miss file list by 1.

[0072] Step 310 , determine whether the current number of misses is greater than a first threshold, if not, execute step 318 and end; if yes, execute step 312 .

[0073] Step 312, obtain the target network file size and the remaining space of the local cache. If the remaining space of the local cache is larger than the target network file size, directly add the target network file to the local cache and add the index value of the target network file to the cache entry table.

[0074] Step 314, if the local cache space is smaller than the target network file size, obtain the file reading frequencies corresponding to all index values ​​in the cache entry table, determine the target index value whose file reading frequency is smaller than the set value, and delete the network file corresponding to the target index value from the local cache.

[0075] After deleting the network file, obtain the local cache space. If the local cache space is still smaller than the target network file size, delete other network files according to the file reading frequency.

[0076] Step 316: Add the target network file to the local cache, add the index value of the target network file to the cache entry table, and set the file reading frequency corresponding to the index value of the target network file to a fixed value.

[0077] The file reading frequency corresponding to the index value of the newly added target network file can be preset to a fixed value. When the target network file is written into the local cache and the index value of the target network file is added to the cache entry table, the number of misses corresponding to the index value of the target network file in the miss file list is restored to 0.

[0078] In this embodiment, target files with a large number of misses are added to the local cache, and network files with a small number of reads are continuously deleted from the local cache based on the regularly updated number of file hits, so that the network files stored in the local cache can dynamically meet the real-time file needs of the terminal. The local cache presents a dynamic balance state, and the cache space always stores the most needed network files.

[0079] In one example, in step 316, after adding the target network file to the local cache, before adding the index value corresponding to the target network file to the cache entry table, the file read frequencies corresponding to all index values ​​in the cache entry table are obtained, and the average value of the obtained file read frequencies is calculated, and the average value is used as the file read frequency corresponding to the index value of the target network file. The index value of the target network file and the corresponding file read frequency are added to the cache entry table, and the number of misses corresponding to the index value in the miss file list is set to 0 at the same time.

[0080] like Figure 4 As shown, the number of misses of index value 1 corresponding to the target network file has reached the set threshold value 3. Therefore, the network file corresponding to index value 1 is written into the local cache, and index value 1 needs to be written into the cache entry table. Before writing, the average value of the file reading frequency corresponding to all index values ​​in the cache entry table is calculated. As shown in the figure, the average value of the file reading frequency corresponding to all index values ​​in the cache entry table is (200+100+10+2) / 4=78. 78 is used as the file reading frequency corresponding to index value 1 to be written and written into the cache entry table. At the same time, the number of misses corresponding to index value 1 in the miss list is set to 0.

[0081] Continue to refer Figure 4 Before writing the network file corresponding to index value 1 into the local cache, you can also first check whether there is an index value in the cache entry table whose file reading frequency is less than the set threshold, and delete the network file corresponding to the index value whose file reading frequency is less than the set threshold from the local cache. For example, the number of file reads corresponding to the index value is 2, which is less than the set threshold 10. Therefore, delete the network file corresponding to index value 8 from the local cache, and remove index value 8 from the cache entry table. Then, when writing the network file corresponding to index value 1 into the local cache, calculate the average value of the file reading frequency corresponding to all index values ​​in the cache entry table: (200+100+10) / 3=103, and write index value 1 and its corresponding file reading frequency 103 into the cache entry table.

[0082] In one embodiment, two miss thresholds are set, a first threshold and a second threshold, wherein the first threshold is greater than the second threshold. If the number of misses corresponding to the index value in the miss file list reaches the first threshold, then regardless of whether the storage space of the local cache is sufficient, the network file corresponding to the index value should be added to the local cache, and the space of the local cache can be released by evicting the existing network files in the local cache. If the number of misses corresponding to the index value in the miss file list is between the first threshold and the second threshold, it is determined whether the local cache can accommodate the network file corresponding to the index value. If so, the network file corresponding to the index value is added to the local cache. If not, no processing is performed.

[0083] This embodiment fully utilizes the local cache space to minimize the probability of file misses.

[0084] It should be understood that although Figure 2-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0085] In one embodiment, Figure 5 As shown, a cache data processing device is provided, comprising:

[0086] The request acquisition module 502 is used to acquire a network file acquisition request, wherein the request carries a resource uniform locator of the network file.

[0087] The index value calculation module 504 is used to determine the index value of the network file according to the resource uniform locator.

[0088] The cache search module 506 is used to obtain the cache entry table and search whether the index value of the network file is recorded in the cache entry table. If not, the number of misses corresponding to the index value in the miss file list is increased by 1.

[0089] The cache module 508 is configured to add the network file obtained from the network server to the local cache and add the index value of the network file to the cache entry table when the number of misses corresponding to the index value is greater than a first threshold.

[0090] In one embodiment, the cache data processing device further includes:

[0091] The network file acquisition module is used to acquire the network file from the local cache if the index value of the network file is recorded in the cache entry table.

[0092] The file reading frequency updating module is used to update the file reading frequency corresponding to the index value of the network file in the cache entry table.

[0093] In one embodiment, the cache module 508 is also used to compare the remaining space in the local cache with the file size of the network file currently requested if the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold; if the local cache space is smaller than the file size of the network file, obtain the target index value of the file read frequency less than a set threshold from the cache entry table; delete the network file corresponding to the target index value from the local cache, and delete the target index value from the cache entry; add the network file currently requested to the local cache, and add the index value of the network file currently requested to the cache entry table.

[0094] In one embodiment, the cache module 508 is also used to calculate the average file read frequency of all the file read frequencies in the cache entry table; add the index value of the network file currently requested to the cache entry table, and set the file read frequency corresponding to the newly added index value to the file read frequency average; in the miss file list, set the number of misses corresponding to the index value of the network file currently requested to 0.

[0095] In one embodiment, the cache module 508 is also used to obtain the remaining space of the local cache in real time. If the remaining space of the local cache is greater than a set threshold, the network file corresponding to the index value with the number of misses greater than a second threshold in the miss file list is added to the local cache, wherein the second threshold is less than the first threshold.

[0096] For the specific definition of the cache data processing device, please refer to the definition of the cache data processing method above, which will not be repeated here. Each module in the above cache data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0097] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cache data processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0098] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0099] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: obtaining a network file acquisition request, the request carrying a resource uniform locator of the network file; determining an index value of the network file according to the resource uniform locator; obtaining a cache entry table, and searching whether the index value of the network file is recorded in the cache entry table; if not, increasing the number of misses corresponding to the index value in the miss file list by 1; when the number of misses corresponding to the index value is greater than a first threshold, adding the network file obtained from the network server to the local cache, and adding the index value of the network file to the cache entry table.

[0100] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the index value of the network file is recorded in the cache entry table, the network file is obtained from the local cache; and the file reading frequency corresponding to the index value of the network file in the cache entry table is updated.

[0101] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold, compare the remaining space in the local cache with the file size of the network file currently requested; if the local cache space is smaller than the file size of the network file, obtain the target index value of the file read frequency less than a set threshold from the cache entry table; delete the network file corresponding to the target index value from the local cache, and delete the target index value from the cache entry; add the network file currently requested to the local cache, and add the index value of the network file currently requested to the cache entry table.

[0102] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the average file read frequency of all the file read frequencies in the cache entry table; adding the index value of the network file currently requested to the cache entry table, and setting the file read frequency corresponding to the newly added index value to the file read frequency average; in the miss file list, setting the number of misses corresponding to the index value of the network file currently requested to 0.

[0103] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the remaining space of the local cache in real time, and if the remaining space of the local cache is greater than a set threshold, adding the network file corresponding to the index value with the number of misses greater than a second threshold in the missed file list to the local cache, wherein the second threshold is less than the first threshold.

[0104] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining a network file acquisition request, wherein the request carries a resource uniform locator of the network file; determining an index value of the network file according to the resource uniform locator; obtaining a cache entry table, and searching whether the index value of the network file is recorded in the cache entry table; if not, increasing the number of misses corresponding to the index value in the miss file list by 1; when the number of misses corresponding to the index value is greater than a first threshold, adding the network file obtained from the network server to the local cache, and adding the index value of the network file to the cache entry table.

[0105] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the index value of the network file is recorded in the cache entry table, the network file is obtained from the local cache; and the file reading frequency corresponding to the index value of the network file in the cache entry table is updated.

[0106] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold, compare the remaining space in the local cache with the file size of the network file currently requested; if the local cache space is smaller than the file size of the network file, obtain the target index value of the file read frequency less than a set threshold from the cache entry table; delete the network file corresponding to the target index value from the local cache, and delete the target index value from the cache entry; add the network file currently requested to the local cache, and add the index value of the network file currently requested to the cache entry table.

[0107] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the average file read frequency of all the file read frequencies in the cache entry table; adding the index value of the network file currently requested to the cache entry table, and setting the file read frequency corresponding to the newly added index value to the file read frequency average; in the miss file list, setting the number of misses corresponding to the index value of the network file currently requested to 0.

[0108] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the remaining space of the local cache in real time, and if the remaining space of the local cache is greater than a set threshold, adding the network file corresponding to the index value with the number of misses greater than a second threshold in the missed file list to the local cache, wherein the second threshold is less than the first threshold.

[0109] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed 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 can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an 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 (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0110] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0111] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A cache data processing method, It is characterized in that The method comprises: Obtain a network file acquisition request, wherein the request carries a resource uniform locator of the network file; Determine the index value of the network file according to the resource uniform locator; Obtaining a cache entry table, and searching whether the index value of the network file is recorded in the cache entry table; If yes, obtaining the network file from the local cache, and updating the file reading frequency corresponding to the index value of the network file in the cache entry table; If not, the number of misses corresponding to the index value in the miss file list is increased by 1; If the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold, compare the remaining space in the local cache with the file size of the network file currently requested; if the remaining space in the local cache is smaller than the file size of the network file, obtain the target index value whose file reading frequency is smaller than the set threshold from the cache entry table; if the remaining space in the local cache after deleting the network file corresponding to the target index value is still smaller than the file size of the network file currently requested, delete other network files according to the file reading frequency; delete the network file corresponding to the target index value from the local cache, and delete the target index value from the cache entry table; add the network file currently requested to the local cache, and add the index value of the network file currently requested to the cache entry table; If the remaining space of the local cache is greater than a set threshold, the network files corresponding to the index values ​​whose miss times are greater than a second threshold in the miss file list are added to the local cache, wherein the second threshold is less than the first threshold.

2. The method according to claim 1, It is characterized in that The network file corresponds to a unique uniform resource locator; the uniform resource locator corresponds to a unique index value.

3. The method according to claim 1, It is characterized in that The file reading frequency represents how frequently the network file in the local cache is requested.

4. The method according to claim 1, It is characterized in that The step of adding the index value of the network file currently requested to the cache entry table comprises: Calculate the average file read frequency of all the file read frequencies in the cache entry table; Adding the index value of the network file currently requested to the cache entry table, and setting the file reading frequency corresponding to the newly added index value to the average file reading frequency; In the missed file list, the number of missed times corresponding to the index value of the network file currently requested is set to 0.

5. The method according to claim 1, It is characterized in that The calculation of the file reading frequency includes calculating an average value of the number of file reading times in multiple time intervals.

6. A cache data processing device, It is characterized in that The device comprises: A request acquisition module, used to acquire a network file acquisition request, wherein the request carries a resource uniform locator of the network file; An index value calculation module, used to determine the index value of the network file according to the resource uniform locator; A cache search module, used to obtain a cache entry table, and to search whether the index value of the network file is recorded in the cache entry table. If not, the number of misses corresponding to the index value is increased by 1 in the miss file list; A network file acquisition module, configured to acquire the network file from a local cache if the index value of the network file is recorded in the cache entry table; A file reading frequency updating module, used for updating the file reading frequency corresponding to the index value of the network file in the cache entry table; A cache module, for comparing the remaining space in the local cache with the file size of the network file currently requested if the number of misses corresponding to the index value of the network file currently requested is greater than a first threshold; if the remaining space in the local cache is smaller than the file size of the network file, obtaining the target index value whose file reading frequency is less than a set threshold from the cache entry table; if the remaining space in the local cache after deleting the network file corresponding to the target index value is still smaller than the file size of the network file currently requested, deleting other network files according to the file reading frequency; deleting the network file corresponding to the target index value from the local cache, and deleting the target index value from the cache entry table; adding the network file currently requested to the local cache, and adding the index value of the network file currently requested to the cache entry table; if the remaining space in the local cache is greater than the set threshold, adding the network file corresponding to the index value whose number of misses is greater than a second threshold in the miss file list to the local cache, wherein the second threshold is smaller than the first threshold.

7. The device according to claim 6, It is characterized in that The cache module is also used to calculate the average file reading frequency of all the file reading frequencies in the cache entry table; add the index value of the network file currently requested to the cache entry table, and set the file reading frequency corresponding to the newly added index value to the file reading frequency average; in the miss file list, set the number of misses corresponding to the index value of the network file currently requested to 0.

8. The device according to claim 7, It is characterized in that The file reading frequency updating module is further used for calculating the file reading frequency, including calculating an average value of the number of file reading times in multiple time intervals.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.