Cache management method, cache proxy server and readable storage medium
By directly using cache identification information in the cache proxy server to locate cache files, avoid storing meta information, the problem of cache service performance degradation due to excessive memory occupancy of meta information, and the saving of memory resources and performance improvement is achieved.
Patent Information
- Application Number
- CN202311270754.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-28
AI Technical Summary
Meta information in existing cache proxy servers occupies a large amount of memory resources, resulting in reduced cache service performance.
By receiving the cache file request initiated by the user, the cache identification information of the cache file is determined, and the target cache path is obtained based on the identification information, and the server is directly accessed to obtain or send the cache file, avoiding storing the meta information of the cache file.
Save a lot of memory resources and improve the performance of cache services, especially when facing massive file services.
Smart Images

Figure CN119728776A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and in particular to a cache management method, a cache proxy server, and a readable storage medium. Background Art
[0002] Internet services are mainly "file provision services". File provision services refer to the act of providing file content from the server to users. That is, the service provider distributes the files in the server to various user terminals, and users can enjoy the service after receiving the files.
[0003] At present, the number of files accessed by users has reached a massive level. The service provider stores a large number of files in the server. The cache proxy server uses meta-information to save some information of these files. For example, the native cache service of the Nginx proxy server can store 1M of content, which can store about 8,000 pieces of meta-information of cached files. When the Nginx cache server receives a file request sent by a user, it determines whether the file exists on the server by searching the meta-information space, and then finds the file according to the storage path of the file and sends it to the user.
[0004] However, with the continuous expansion of server storage resources, more and more memory is needed to store metadata. Taking the CDN server as an example, its hard disk is configured with 192T storage space. If the file size is 1M, the memory resource consumed to store metadata is 25G. Therefore, when facing massive file services, it is easy to have insufficient memory resources and reduced cache service performance. Summary of the invention
[0005] The embodiments of the present application provide a cache management method, a cache proxy server, and a readable storage medium, which are used to solve the problem that meta information in the existing cache proxy server occupies a large amount of memory resources and reduces the cache service performance.
[0006] In a first aspect, an embodiment of the present application provides a cache management method, including:
[0007] Receive a cache file request initiated by a user terminal, and determine cache identification information of a cache file corresponding to the cache file request;
[0008] Acquire a target cache path that matches the cache identification information, and access the server according to the target cache path;
[0009] In the case that the cache file exists in the server, the cache file is sent to the client.
[0010] In a second aspect, an embodiment of the present application provides a cache proxy server, comprising a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect above are implemented.
[0011] In a third aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0012] The cache management method provided in the embodiment of the present application receives a cache file request initiated by a user end, determines the cache identification information of the cache file corresponding to the cache file request; obtains the target cache path that matches the cache identification information, and accesses the server according to the target cache path; and sends the cache file to the user end when the cache file exists in the server. In this way, the cache file can be located without storing the metadata of the cache file. When facing a large number of file services, it can avoid loading the metadata of a large number of cache files into the memory, saving memory resources, and thus helping to improve the performance of the cache service.
[0013] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0015] Figure 1 A schematic diagram of a possible application scenario is shown;
[0016] Figure 2 A schematic diagram of a process flow of a cache management method provided in an embodiment of the present application is shown;
[0017] Figure 3 A schematic diagram showing a flow chart of another cache management method provided in an embodiment of the present application is shown;
[0018] Figure 4 A schematic diagram of a process flow of another cache management method provided in an embodiment of the present application is shown;
[0019] Figure 5 A schematic diagram of the structure of a cache management system provided by an embodiment of the present application is shown;
[0020] Figure 6 A schematic diagram of an aging process of a cache file provided in an embodiment of the present application is shown;
[0021] Figure 7A schematic diagram of the structure of a cache proxy server provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0023] File provisioning refers to the act of providing the file content of the server to the user, such as Figure 1 As shown in the figure, for the process of the client requesting a file from the server, the client sends the file request to the server through the network, and the server sends the corresponding file to the client according to the request. The client receives the file and completes the file request. Nginx (enginex) is a high-performance HTTP and reverse proxy web server. After the client accesses the server, the Nginx cache proxy server saves the metadata of the cached files that have been visited. The next time the relevant content is accessed, it can be directly searched through the metadata. In this way, the time and resource consumption of repeatedly accessing the original source can be avoided, and the efficiency is improved to a limited extent.
[0024] However, as server storage resources continue to expand, more and more memory is required to store metadata. When facing massive file services, it is easy to encounter problems such as insufficient memory resources and reduced cache service performance.
[0025] In view of the problems existing in the process of providing the above-mentioned file services, the embodiment of the present application provides a cache management method, which can be applied to a cache proxy server to avoid loading a large amount of metadata of cached files into the memory, save memory resources, and improve cache service performance. Figure 2 As shown, the cache management method 200 specifically includes the following steps:
[0026] S201: receiving a cache file request initiated by a user terminal, and determining cache identification information of a cache file corresponding to the cache file request;
[0027] S202: Acquire a target cache path that matches the cache identification information, and access a server according to the target cache path;
[0028] S203: When the cache file exists in the server, send the cache file to the user end.
[0029] Among them, the cached files can be CCS files, HTML files, video files, audio files, text files, compressed packages, etc.; the server can be a server supporting RTSP on-demand business scenarios, a server supporting HLS on-demand and live broadcast scenarios, a server supporting RTMP live broadcast scenarios, a server supporting DASH on-demand business scenarios, a server supporting HTTP-FLV live broadcast scenarios, a server supporting HTTP file request scenarios, etc., which can be specifically classified as a sending server.
[0030] In a specific implementation, the user initiates a cache file request to the cache proxy server through the user terminal. After receiving the cache file request, the related technology first determines the cache key of the cache file, searches for the metadata of the cache file corresponding to the cache key in the cache key red-black tree in the metadata space, and determines that the cache file requested by the user exists in the server when the metadata of the cache file is found, and then reads the cache file from the server's disk according to the cache file path and sends it to the user. The embodiment of the present application optimizes the process, removes the metadata management process, directly determines the cache file identification information of the corresponding cache file according to the cache file request, determines the target cache path that matches the cache identification information, and accesses the server according to the target cache path; and sends the cache file to the user terminal when the cache file exists in the server.
[0031] In this way, the target cache path that matches the cache identification information is directly determined, and the cache file is searched according to the target cache path without storing the metadata of the cache file. When facing massive file services, it can avoid loading the metadata of a large amount of cache files into the memory, saving memory resources, which is conducive to improving the cache service performance.
[0032] The cache identification information of the cache file corresponding to the cache file request may be determined in the following manner:
[0033] Obtaining a uniform resource locator address in the cache file request; performing a hash operation on the uniform resource locator address to obtain cache identification information of the cache file corresponding to the cache file request.
[0034] In a specific implementation, the cache proxy server receives a cache file request initiated by a user terminal, obtains the uniform resource location URL in the cache file request, and can obtain the cache identification information of the cache file corresponding to the cache file request by performing a hash operation on the URL. The cache identification information is the name of the cache file, which is unique. For example, the preset number of digits of the uniform resource name and the storage path in the URL is extracted, and the MD5 value of the preset number of digits of the uniform resource name and the access path is calculated, and the MD5 value is used as the cache identification information of the cache file. Here, MD5 (Message Digest Algorithm 5) is a hash algorithm used to convert data of any length into a hash value of a fixed length.
[0035] Then, the target cache path that matches the cache identification information can be obtained in the following way:
[0036] Acquire multiple pre-configured cache paths; and determine the target cache path according to the degree of matching between each cache path in the multiple cache paths and the cache identification information.
[0037] In a specific implementation, since the embodiment of the present application directly determines the cache identification information of the cache file according to the cache file request, the cache identification information carries the storage path of the cache file, and then, multiple pre-configured cache paths can be obtained, and the target cache path can be determined according to the degree of matching between each cache path in the multiple cache paths and the cache identification information. For example, the cache identification information of the cache file is determined according to the preset number of digits of the uniform resource name and the storage path in the URL, and the cache identification information carries a storage path with a preset number of digits, and then, a cache path that matches the storage path with the preset number of digits can be selected as the target cache path of the cache file. That is, regardless of whether the cache file exists in the server, the path of the cache file is unique, and the Nginx cache proxy server can search for the cache file according to the unique cache file path.
[0038] The Nginx cache proxy server searches for the cache file in the server according to the calculated target cache path, and sends the cache file to the user end if the cache file exists in the server.
[0039] In a possible implementation, Figure 3 As shown, the cache management method 200 further includes:
[0040] S204: If the cache file does not exist in the server, request the cache file from the second network node in the target content distribution network, and send the cache file to the user end;
[0041] The target content distribution network includes a first network node and a second network node corresponding to the server, and the second network node is an upper-level network node adjacent to the first network node.
[0042] In the specific implementation, Figure 4 As shown, a cache file request is obtained; cache identification information of the cache file is calculated according to the uniform resource locator URL in the cache file request; a cache file path matching the cache identification information is determined; and it is determined whether the cache file requested to be found exists. If the cache file does not exist in the server, the first network node corresponding to the server can send a source request back to the upper network node in the target content distribution network, request the cache file step by step until the source station, download the cache file and save it to the disk, send it to the user end, and save the cache file in the calculated cache file path, thereby ending this cache file request.
[0043] In this way, since there is no need to save the metadata of the cached files, a large amount of memory resources can be saved in the massive file service scenario. If there are 500 million cached files on the server, the Nginx cache proxy server can save 61G of memory resources. The operating system can use the saved memory resources in the cache file cache and buffer cache, which significantly improves the service performance of the cache proxy server.
[0044] In addition, since the cache file hit rate of the current CDN cache service system is generally above 90%, a large number of cache files exist in the server itself. The cache management method provided by the embodiment of the present application can speed up the speed of caching files on the Nginx cache proxy server. When the cache resource requested by the user is not on the server, the cache file path assembled is used to directly find out whether the cache file exists. Overall, when the service hit rate is high, the cache management method is used to help speed up the location of cache files and improve the service rate.
[0045] Since the Nginx cache proxy server does not need to store the metadata of the cached files, the cache file loading aging function of the Nginx cache proxy server will not take effect. When facing a large number of cached file services, the cache loading aging of the Nginx cache proxy server has at least the following problems:
[0046] (1) The cache file loading time is too long. When there are about 500 million cache files on the server, Nginx needs to traverse all files in the cache directory and generate cache meta information in order to load the meta information of these cache files into the Nginx cache meta information space. Due to the large number of files, Nginx needs to spend a lot of resources and time to load cache files. Generally, it takes 1 month to successfully load all cache files.
[0047] (2) The aging speed of cache files is too slow. Since Nginx determines which cache files need to be deleted and aged first based on the LRU linked list of the metadata space, it needs to assemble the LRU linked list and traverse the linked list. In the scenario of massive cache file service, the speed of Nginx deleting files cannot keep up with the speed of newly generated cache files. As time goes by, the cache files of the cache proxy server itself will increase and gradually approach the hard disk capacity.
[0048] Based on this, Figure 5 As shown, an embodiment of the present application provides a cache management system. When receiving a user request, the Nginx cache proxy server uses the above-mentioned cache management method to search and read the cache file from the server's disk, and sends the cache file to the user. At the same time, a cache file aging module is also added, and the cache file aging module directly ages and deletes the cache files to be aged under the cache file path. Among them, the cache file aging module can use a shell script method, or a python script method, or it can be embedded in the cache management method process of the Nginx cache proxy server. Specifically, in the above-mentioned step S201, before receiving the cache file request initiated by the user end, it also includes:
[0049] At a preset aging time point, cache files to be aged in a target cache directory in the server are obtained; and a target number of cache files to be aged in the server are deleted according to a preset file aging rule.
[0050] Among them, the aging time point can be a specific pre-set time point, for example, time point 0:00, time point 1:00, etc., or it can be any time point selected during the non-working time period of the cache proxy server; the file aging rule can be to sort the cache files according to the access time, or to sort them according to any rules such as file size, number of accesses, etc., and delete a certain proportion of cache files to be aged.
[0051] In a specific implementation, when the time reaches the preset aging time point, the cache files to be aged under the target cache directory in the server are obtained, where the target cache directory can be a level 1 directory or a level 3 directory, which can be determined based on the number of files in each level directory or based on the server performance. Taking a two-level cache directory as an example, the path of a cache file is:
[0052] / mnt / cache / disk007 / 9 / ff / 365d23b84c1554330b6dd5a78dfe2ff9
[0053] Among them, 9, ff represent hierarchical directories. In this configuration, there are 16 first-level directories, 0 to f, and 256 second-level directories, 00 to ff. Therefore, the cache server has a total of 4096 cache file storage directories.
[0054] The cache file aging module obtains cache files in a cache directory for aging at a time, and after entering the cache directory, deletes a target number of cache files to be aged in the server according to a preset file aging rule.
[0055] Among them, the cache file aging module also monitors the service index of the server during the process of deleting the cache files to be aged in the server; determines the aging rate of the cache files to be aged according to the comparison result between the service index and the preset service index threshold; and deletes the target number of cache files to be aged in the server according to the aging rate according to the preset aging rule, wherein the aging rate is used to represent the number of cache files to be aged deleted per unit time.
[0056] In this way, the file aging rate is dynamically adjusted according to the server's service indicators. When server resources are insufficient or user service is of poor quality, the aging rate of cached files can be quickly reduced to avoid affecting service indicators and improve service effectiveness.
[0057] Optionally, the above-mentioned determining the aging rate of the cache file to be aged according to the comparison result between the service indicator and the preset service indicator threshold includes:
[0058] Obtaining a current first aging rate of the cached files to be aged in the server;
[0059] When the service indicator is lower than the service indicator threshold, reducing the first aging rate to a second aging rate according to a preset rate adjustment value, and determining the second aging rate as the aging rate of the cache file to be aged;
[0060] When the service indicator is not lower than the service indicator threshold, the first aging rate is increased to a third aging rate according to the rate adjustment value, and the third aging rate is determined as the aging rate of the cache file to be aged.
[0061] In a specific implementation, the cache file aging module can gradually reduce the aging rate according to the rate adjustment value when the service index is lower than the service index threshold (that is, the service quality is poor); when the service index is not lower than the service index threshold, the aging rate can be gradually accelerated according to the rate adjustment value to ensure that the number of cache files on the server is always at a relatively reasonable level, avoiding an increase in the number of cache files and causing insufficient disk capacity.
[0062] Among them, the above-mentioned service indicators include server performance indicators and cache service indicators, among which the server performance indicators are used to characterize server performance, such as central processing unit (CPU) utilization, memory utilization, IO wait, etc. Here, IO wait means that the CPU is in an idle state and there are unfinished disk IO requests; the cache service indicators are used to characterize the quality of the service provided by the cache file in the server, such as cache file service success rate indicator, transmission control protocol (TCP) connection number indicator, cache file service first packet delay, etc.
[0063] Wherein, deleting a target number of cache files to be aged in the server according to a preset file aging rule includes:
[0064] Obtaining a target access time point of the cache file to be aged, wherein the target access time point is an access time point with the shortest time interval between the multiple access time points of the cache file to be aged and the aging time point;
[0065] According to the target access time point, a target number of cache files to be aged in the server are deleted.
[0066] In the specific implementation, Figure 6 As shown, the cache file aging module is started, and the cache file classification directory is obtained. After entering the cache directory, the cache files are first sorted according to the most recent access time, so that the files that have not been accessed for the longest time can be obtained, avoiding the aging and deletion of the cache files with higher popularity. Then, according to the configured target number (in actual applications, the target number is usually determined according to the aging ratio), the files that have not been accessed for the longest time are deleted. Since the cache file aging module does not need to traverse the Nginx meta information LRU (Least Recently Used) linked list to age the files, but deletes the cache files under each target cache directory in the server in parallel, the aging efficiency of this method is higher than the aging efficiency of the Nginx native aging files.
[0067] Figure 7A schematic diagram of the hardware structure of the cache proxy server provided by the embodiment of the present application is shown. Referring to the figure, at the hardware level, the cache proxy server includes a processor, and optionally, an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the cache proxy server may also include hardware required for other services.
[0068] The processor, the network interface and the memory may be interconnected through an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0069] The memory stores the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0070] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating the target user at the logical level. The processor executes the program stored in the memory and specifically performs: Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0071] The above application Figure 2The method disclosed in the illustrated embodiment may be implemented in a processor or by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0072] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0073] Of course, in addition to software implementation methods, the cache proxy server of the present application does not exclude other implementation methods, such as logical devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logical unit, but can also be hardware or logical devices.
[0074] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by a cache proxy server including multiple application programs, the cache proxy server executes Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0075] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0076] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 2 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0077] The embodiments of the present application can be applied to various scenarios of cache proxy server collaboration or interconnection, including: collaborative interconnection between mobile phones and laptops / tablet computers; collaborative interconnection between mobile terminals and smart TVs / displays; collaborative interconnection between mobile phones or tablet computers and in-car entertainment systems; collaborative interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0078] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0079] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0080] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0081] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0082] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A cache management method, characterized in that: include: Receive a cache file request initiated by a user terminal, and determine cache identification information of a cache file corresponding to the cache file request; Acquire a target cache path that matches the cache identification information, and access the server according to the target cache path; In the case that the cache file exists in the server, the cache file is sent to the client.
2. The method according to claim 1, characterized in that The determining the cache identification information of the cache file corresponding to the cache file request includes: Obtaining a uniform resource locator address in the cache file request; A hash operation is performed on the uniform resource locator address to obtain cache identification information of the cache file corresponding to the cache file request.
3. The method according to claim 1, characterized in that The acquiring the target cache path matching the cache identification information includes: Get multiple pre-configured cache paths; The target cache path is determined according to a matching degree between each cache path in the plurality of cache paths and the cache identification information.
4. The method according to claim 1, characterized in that After accessing the server according to the target cache path, the method further includes: In the case that the cache file does not exist in the server, requesting the cache file from a second network node in the target content distribution network, and sending the cache file to the user terminal; The target content distribution network includes a first network node and a second network node corresponding to the server, and the second network node is an upper-level network node adjacent to the first network node.
5. The method according to claim 1, characterized in that Before receiving the cache file request initiated by the user terminal, the method further includes: Obtaining the cache files to be aged in the target cache directory in the server at a preset aging time point; A target number of cached files to be aged in the server are deleted according to a preset file aging rule.
6. The method according to claim 5, characterized in that The deleting a target number of cached files to be aged in the server according to a preset file aging rule includes: Monitoring service indicators of the server; Determining an aging rate of the cache file to be aged according to a comparison result between the service indicator and a preset service indicator threshold; According to a preset aging rule, a target number of cache files to be aged in the server are deleted at the aging rate, wherein the aging rate is used to represent the number of cache files to be aged that are deleted per unit time.
7. The method according to claim 6, characterized in that Determining the aging rate of the cache file to be aged according to a comparison result between the service indicator and a preset service indicator threshold value includes: Obtaining a current first aging rate of the cached files to be aged in the server; When the service indicator is lower than the service indicator threshold, reducing the first aging rate to a second aging rate according to a preset rate adjustment value, and determining the second aging rate as the aging rate of the cache file to be aged; When the service indicator is not lower than the service indicator threshold, the first aging rate is increased to a third aging rate according to the rate adjustment value, and the third aging rate is determined as the aging rate of the cache file to be aged.
8. The method according to claim 6, characterized in that The service index includes a server performance index and a cache service index, wherein the cache service index is used to characterize the quality of service provided by the cache file in the server.
9. The method according to claim 5, characterized in that The deleting a target number of cached files to be aged in the server according to a preset file aging rule includes: Obtaining a target access time point of the cache file to be aged, wherein the target access time point is an access time point with the shortest time interval between the multiple access time points of the cache file to be aged and the aging time point; According to the target access time point, a target number of cache files to be aged in the server are deleted.
10. A cache proxy server, characterized in that: The cache proxy server comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.