Dynamic cache management method for optimizing real-time search performance

By storing resources of different storage amounts in the dynamic cache and obtaining real-time search efficiency curves, and setting fixed and variable storage amounts, the problem of inability to effectively retain user attention data in the prior art is solved, and real-time search performance and user search efficiency are improved.

CN120086156AActive Publication Date: 2025-06-03BEIJING XUNAO TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510207175.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-03
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

The existing dynamic cache management methods cannot effectively retain the data that users pay attention to, and cannot flexibly adjust the amount of data retained in the dynamic cache, resulting in a degradation of real-time search performance and affecting the user's search efficiency.

Method used

By storing resources with different storage amounts in the dynamic cache, real-time search efficiency curves are obtained when resources with different storage amounts are obtained, memory usage is obtained based on the curve, and fixed storage and variable storage in the dynamic cache are set. When searching in real time, set fixed cache content and variable storage space based on the searched content.

Benefits of technology

It realizes effective retention of data that users pay attention to in dynamic cache, flexibly adjusts the amount of data retained, and improves real-time search performance and user search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086156A_ABST
    Figure CN120086156A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic cache management method for optimizing real-time search performance, which relates to the technical field of dynamic cache management and comprises the following steps of: acquiring a search efficiency curve of real-time search when a dynamic cache contains resources with different storage contents; obtaining a memory occupation amount; setting fixed cache content in the dynamic cache based on the searched content; the method is used for solving the problems that in an existing dynamic cache management method, data which a user pays attention to cannot be reserved in a dynamic cache, and the data volume of the reserved data in the dynamic cache cannot be flexibly adjusted, so that when the user browses a large amount of data, the real-time search performance is affected due to the fact that the dynamic cache reserves more data, and the user experience is poor. Therefore, the problem that the search efficiency of the user is affected due to poor real-time search performance when the user returns to the data which the user pays attention to is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dynamic caching, and specifically to a dynamic cache management method for optimizing real-time search performance. Background Art

[0002] Dynamic caching is a technical means used to store data that frequently changes but does not need to be retrieved from the server every time during user access; this data can be HTML fragments, pictures, JavaScript files, or other types of resources; through dynamic caching, when the user requests the same or similar content again, the system can directly read from the cache without having to perform complex calculations or database queries again, thereby greatly improving the response speed and enhancing the user experience.

[0003] Existing methods for dynamic cache management usually analyze multiple channels using dynamic caching, obtain cache allocation parameters based on the demand for dynamic caching in each channel, and perform dynamic cache allocation when allocating caches to multiple resource channels based on the cache allocation parameters, so as to achieve the purpose that each resource channel can effectively utilize dynamic caching. Although this improved method can improve the utilization rate of dynamic caching in multiple resource channels, it can only allocate a fixed amount of dynamic cache to each resource channel based on the cache allocation parameters after the dynamic cache demand is issued by multiple resource channels. It cannot retain the data that users focus on in the dynamic cache, and cannot flexibly adjust the amount of data retained in the dynamic cache. As a result, when users browse a large amount of data, the dynamic cache is affected by retaining a large amount of data, which affects the real-time search performance, resulting in the problem that when users revisit the data they focus on, the real-time search performance is poor, which affects the search efficiency of users. For example, in the patent application with the publication number CN118656313A, a multi-channel dynamic cache management method, system, device, and medium are disclosed. This solution controls the allocator to perform periodic cache resource allocation for each resource processing channel and controls the corresponding resource processing channel to work periodically according to the cache allocation parameters, resource application scenarios, and the working relationships index of each channel. Other improvements in dynamic cache management are usually in terms of resource saving, and still cannot retain the data that users focus on in the dynamic cache, and cannot flexibly adjust the amount of data retained in the dynamic cache. As a result, when users browse a large amount of data, the dynamic cache is affected by retaining a large amount of data, which affects the real-time search performance, resulting in the problem that when users revisit the data they focus on, the real-time search performance is poor, which affects the search efficiency of users. In view of this, it is necessary to improve the existing dynamic cache management method. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems in the prior art to some extent. By proposing a dynamic cache management method for optimizing real-time search performance, it is used to solve the problems in the existing dynamic cache management methods, where it is impossible to retain the data that users focus on in the dynamic cache, and it is impossible to flexibly adjust the amount of data retained in the dynamic cache. As a result, when users browse a large amount of data, the dynamic cache affects the real-time search performance due to retaining more data, and it will affect the search efficiency of users when they revisit the data they focus on due to the poor real-time search performance.

[0005] To achieve the above object, the present application provides a dynamic cache management method for optimizing real-time search performance, including the following steps: Store resources with different storage amounts in the dynamic cache, and obtain the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts; Obtain the memory occupancy based on the search efficiency curve; set the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy; When performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount.

[0006] Further, storing resources with different storage amounts in the dynamic cache and obtaining the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts includes: Record the total storage amount of resources that can be stored in the dynamic cache as the total storage amount; obtain multiple data that can be stored in the dynamic cache, and sequentially record the data with the smallest to largest resource space occupied by each data as the storable data KC 1 to the storable data KC n , where the resource space occupied by the storable data KC n is less than or equal to the total storage amount; Obtain all combinations of the storable data KC 1 to the storable data KC n that can be stored in the dynamic cache, and record them as storage combinations; record the size of the resource space occupied by all the storable data KC in each storage combination as the combined occupancy space of the storage combination; Based on the size of the combined occupancy space of all storage combinations, sequentially record all storage combinations as the storage combination CZ 1 to the storage combination CZ m ; Use the dynamic storage analysis method to obtain the storage resource amount corresponding to the combined occupancy space of all storage combinations CZ, and obtain the search efficiency curve corresponding to each storage resource amount.

[0007] Further, the dynamic storage analysis method includes: Establish a rectangular coordinate system, denoted as the occupancy analysis coordinate system. Among them, the unit of the Y-axis of the occupancy analysis coordinate system is byte, and the coordinate points from the origin to the right on the X-axis are sequentially filled with the storable data KC 1 to the storable data KC n ; for any storable data KC, the coordinate point corresponding to X = storable data KC and Y = the size of the resource space occupied by the storable data KC is denoted as the occupancy point of the storable data KC; Obtain the occupancy points corresponding to all storable data KC, and denote the curve obtained by fitting all occupancy points as the occupancy analysis curve; denote the size of the resource space occupied by the storable data KC n as Y 0 , and denote the ordinate of the point with the largest slope in the occupancy analysis curve from Y = 0 to Y = Y 0 / 2 as Y min .

[0008] Further, the dynamic storage analysis method also includes: Analyze the storage combinations CZ 1 to the storage combinations CZ m in turn using the combination fusion method; the combination fusion method is: denote the storage combination CZ to be analyzed as the storage combination CZ c , where c is a positive integer less than or equal to m and greater than or equal to 1; denote the combined occupancy space of the storage combination CZ c as Y 1 , and denote [Y 1 -Y min ,Y 1 +Y min as the fusion interval of the storage combination CZ c ; When the combined occupancy space of any storage combination CZ other than the storage combination CZ c is within the fusion interval of the storage combination CZ c , denote the storage combinations CZ whose combined occupancy space is within the fusion interval of the storage combination CZ c and other than the storage combination CZ c as the to-be-fused combinations of the storage combination CZ c ; denote the average value of the combined occupancy space of the storage combination CZ c and the combined occupancy spaces of all to-be-fused combinations as the storage resource amount of the storage combination CZ c and all to-be-fused combinations of the storage combination CZ c .

[0009] Further, the dynamic storage analysis method also includes: When the combined occupied spaces of all storage combinations CZ other than the storage combination CZ c are not within the fusion interval of the storage combination CZ c , record the combined occupied space of the storage combination CZ c as the storage resource amount of the storage combination CZ c ; Obtain the storage resource amounts of all storage combinations CZ based on the combination fusion method.

[0010] Furthermore, the dynamic storage analysis method further includes: For any storage resource amount, store data with a size equal to the storage resource amount in the dynamic cache, and use the search engine where the dynamic cache is located to search for any entry; establish a rectangular coordinate system, denoted as the search analysis coordinate system, where the unit of the X-axis of the search analysis coordinate system is time and the Y-axis is the constant axis; plot the corresponding curve in the search analysis coordinate system based on the relationship between the time after searching for any entry using the search engine where the dynamic cache is located and the number of resources obtained by the search, and denote it as the search efficiency curve of the storage resource amount.

[0011] Furthermore, obtain the memory occupancy based on the search efficiency curve; setting the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy includes: Establish a rectangular coordinate system, denoted as the multi-curve screening coordinate system, where the unit of the X-axis of the multi-curve screening coordinate system is time and the Y-axis is the constant axis; place all the search efficiency curves in the multi-curve screening coordinate system, and denote the point with the maximum slope among all the search efficiency curves as the high-efficiency search point of the search efficiency curve; Denote the average value of the abscissas of all the high-efficiency search points as the average high-efficiency time; denote the straight line obtained by fitting all the search efficiency curves as the comprehensive efficiency straight line; denote the straight line obtained by fitting each search efficiency curve as the fitting efficiency straight line of the search efficiency curve; Use the occupancy analysis algorithm to obtain the occupancy parameter of each high-efficiency search point, and the occupancy analysis algorithm is: , where F is the occupancy parameter, t is the abscissa of the high-efficiency search point, t av is the average high-efficiency time, k is the slope of the fitting efficiency straight line of the search efficiency curve where the high-efficiency search point is located, and k av is the slope of the comprehensive efficiency straight line.

[0012] Furthermore, obtaining the memory occupancy based on the search efficiency curve; setting the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy further includes: Denote the efficient search point corresponding to the smallest occupancy parameter as the memory occupancy point, and denote the storage resource amount corresponding to the memory occupancy point as the memory occupancy amount; Denote the average value of all occupancy parameters as the measurement parameter, and denote the efficient search points whose occupancy parameters are less than the measurement parameter and are not the memory occupancy point as the optional occupancy points, and denote the storage resource amounts of the optional occupancy points as the optional occupancy amounts; Denote the memory occupancy amount and all optional occupancy amounts as the fixed storage amount of the dynamic cache; Denote the value obtained by subtracting the memory occupancy amount from the total storage amount as the memory variable amount; Denote the values obtained by subtracting all optional occupancy amounts from the total storage amount respectively as the optional variable amounts; Denote the memory variable amount and all optional variable amounts as the variable storage amount.

[0013] Further, when performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount, including: Denote the value obtained by dividing the memory occupancy amount by the total storage amount as the memory occupancy ratio; When performing real-time search, obtain the web pages based on search jumps in real time, and denote the number of times each web page is opened as the web page occupancy times of the web page, and denote the total number of times all web pages are opened as the total jump times; For any web page, when the value obtained by dividing the web page occupancy times of the web page by the total jump times is greater than the memory occupancy ratio, and the number of times the web page is opened is greater than the quantity of the fixed storage amount, denote the web page as a fixed storage web page.

[0014] Further, when performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount also includes: When the space occupied by all fixed storage web pages is less than or equal to the memory occupancy amount, denote all fixed storage web pages as the fixed cache content, and create a memory storage space in the dynamic cache to store the fixed cache content, where the space occupied by the memory storage space is the memory occupancy amount; When the space occupied by all fixed storage web pages is greater than the memory occupancy amount and less than or equal to the maximum value in the fixed storage amount, denote the fixed storage amount with the smallest difference from the space occupied by all fixed storage web pages among all fixed storage amounts as the variable occupancy amount; After adjusting the space occupied by the memory storage space to the variable occupancy amount, denote all fixed storage web pages as the fixed cache content, and store them in the memory storage space; When the space occupied by all fixed storage web pages is greater than the maximum value in the fixed storage amount, denote the maximum value in the fixed storage amount as G max and adjust the space occupied by the memory storage space to G max, and storing the latest stored web pages among all the stored web pages in the memory storage space in sequence, and when the memory storage space is full, deleting the stored web pages that are not stored in the memory storage space; The fixed storage amount corresponding to the space occupied by the memory storage space is obtained in real time and recorded as the practical storage amount, and the variable storage amount obtained based on the practical storage amount is recorded as the practical variable amount; a variable storage space is created in the dynamic cache to store the latest acquired web pages, wherein the space occupied by the variable storage space is the practical variable amount, and each time a new web page is opened, the data stored in the variable storage space is updated.

[0015] Beneficial effects of the present invention: the present application first stores resources of different storage amounts in a dynamic cache, and obtains a search efficiency curve of real-time search when the dynamic cache contains resources of different storage amounts; then obtains the memory usage based on the search efficiency curve. This has the advantage that, by obtaining the search dynamic curve corresponding to the dynamic cache containing resources of different storage amounts, and obtaining the memory usage, a more versatile fixed storage space can be set in the dynamic cache when storing different data, which is helpful in retaining the data that the user focuses on in the dynamic cache in actual application, and is helpful in directly calling out the retained data when the user revisits the data that the user focuses on without being affected by the poor real-time search performance, thereby improving the user's search efficiency; The present application also sets a fixed storage capacity and a variable storage capacity in the dynamic cache based on the memory usage; finally, when searching in real time, a fixed cache content is set in the dynamic cache based on the searched content and the fixed storage capacity, and a variable storage space is set based on the searched content and the variable storage capacity. The advantage of this is that by setting the variable storage capacity and setting the fixed cache content based on the searched content, it is helpful to flexibly adjust the amount of data retained in the dynamic cache to prevent the user from browsing a large amount of data due to the small fixed storage space in the dynamic cache and being unable to retain the user's concerned data, thereby improving the user's search efficiency when browsing a large amount of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of the steps of the method of the present invention; Figure 2 A schematic diagram of an occupancy analysis coordinate system of the present invention; Figure 3 It is a schematic diagram of the multi-curve screening coordinate system of the present invention; Figure 4 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0018] Embodiment 1. Please refer to Figure 1 As shown, the present application provides a dynamic cache management method for optimizing real-time search performance, including the following steps: Step S1, store resources with different storage amounts in the dynamic cache, and obtain the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts; Step S1 includes: Step S101, record the total storage amount that can be stored in the dynamic cache as the total storage capacity; obtain multiple data that can be stored in the dynamic cache, and sequentially record them as storable data KC 1 to storable data KC n in ascending order of the resource space occupied by each data, where the resource space occupied by the storable data KC n is less than or equal to the total storage capacity; In a specific implementation process, for example, in a data processing, the total storage amount that can be stored in the dynamic cache is 2G, then the total storage capacity can be set to 2G; the storable data KC can be set according to the actual data obtained, such as the storable data KC can select data with a size of 1MB, 10MB, 20MB, etc.; the more the number of storable data KC, the more accurate the analysis result can be and the more in line with the actual state of the dynamic cache in subsequent analysis; Step S102, obtain all combinations of the storable data KC 1 to the storable data KC n that can be stored in the dynamic cache, and record them as storage combinations; record the size of the resource space occupied by all the storable data KC in each storage combination as the combined occupied space of the storage combination; Based on the size of the combined occupied space of all storage combinations, sequentially record all storage combinations as storage combination CZ 1 to storage combination CZ m ; In a specific implementation process, for example, in a data processing, the obtained storable data KC includes storable data KC n1 and storable data KC n2 , and the space sizes occupied by the storable data KC n1 and the storable data KC n2 are 1MB and 10MB, then the storable data KCn1 and the storable data KC n2 The combined occupied space of the storage combination CZ formed is 11MB, where both n1 and n2 are positive integers less than or equal to n and greater than or equal to 1; Step S103, use the dynamic storage analysis method to obtain the storage resource amounts corresponding to the combined occupied spaces of all storage combinations CZ, and obtain the search efficiency curve corresponding to each storage resource amount; The dynamic storage analysis method includes: establishing a plane rectangular coordinate system, denoted as the occupancy analysis coordinate system. Among them, the unit of the Y-axis of the occupancy analysis coordinate system is bytes, and the coordinate points on the X-axis from the coordinate origin to the right are filled in with the storable data KC 1 to the storable data KC n ; For any storable data KC, the coordinate point with X = storable data KC and Y = the size of the resource space occupied by the storable data KC is denoted as the occupancy point of the storable data KC; In the specific implementation process, for example, in a data analysis, the obtained occupancy analysis coordinate system is as Figure 2 shown, where KC1 to KC5 are the storable data KC 1 to the storable data KC n , the point where the center of the ○ is located is the occupancy point, and the curve QQ1 is the occupancy analysis curve obtained based on all occupancy points. Based on the analysis, the value of n in the occupancy analysis coordinate system is 5, and the size of the resource space occupied by the storable data KC 5 is denoted as 11MB. Then, the ordinate of the point with the largest slope in the area between Y = 0 and Y = 5.5MB on the occupancy analysis curve QQ1 can be used as the value that is relatively small and changes greatly in the space occupied by all storable data KC, which helps to fuse the storage combination CZ through this value in the subsequent analysis, so as to reduce the number of storage resource amounts while ensuring that the storage resource amount obtained after fusion can represent most storage combinations CZ, thereby improving the subsequent analysis efficiency; Obtain the occupancy points corresponding to all storable data KC, and denote the curve obtained by fitting all occupancy points as the occupancy analysis curve; Denote the size of the resource space occupied by the storable data KC n as Y 0 , and denote the ordinate of the point with the largest slope in the area between Y = 0 and Y = Y 0 / 2 on the occupancy analysis curve as Y min ; Analyze the storage combinations CZ that do not contain storage resource amounts in turn 1 to the storage combination CZ m using the combination fusion method; The combination fusion method is: Denote the storage combination CZ to be analyzed as the storage combination CZ c , where c is a positive integer less than or equal to m and greater than or equal to 1; Denote the storage combination CZc The combined occupied space is denoted as Y 1 , and [Y 1 -Y min ,Y 1 +Y min is denoted as the storage combination CZ c 's fusion interval; In the specific implementation process, for example, during a data processing, the obtained Y min is 2MB, and the combined occupied space of the storage combination CZ c is 5MB, then the fusion interval can be set as [3MB, 7MB]. Then, the storage combination CZ whose combined occupied space is within [3MB, 7MB] is denoted as the storage combination CZ c 's to-be-fused combination, and subsequent analysis is carried out; When the combined occupied space of any storage combination CZ other than the storage combination CZ c is within the fusion interval of the storage combination CZ c , the storage combination CZ whose combined occupied space is within the fusion interval of the storage combination CZ c and other than the storage combination CZ c is denoted as the storage combination CZ c 's to-be-fused combination; The average value of the combined occupied space of the storage combination CZ c and the combined occupied spaces of all to-be-fused combinations is denoted as the storage resource amount of the storage combination CZ c and all to-be-fused combinations of the storage combination CZ c ; When the combined occupied spaces of all storage combinations CZ other than the storage combination CZ c are not within the fusion interval of the storage combination CZ c , the combined occupied space of the storage combination CZ c is denoted as the storage resource amount of the storage combination CZ c ; Obtain the storage resource amounts of all storage combinations CZ based on the combined fusion method; For any storage resource amount, store data with a size of the storage resource amount in the dynamic cache, and use the search engine where the dynamic cache is located to search for any entry; Establish a plane rectangular coordinate system, denoted as the search analysis coordinate system. Among them, the unit of the X-axis of the search analysis coordinate system is time, and the Y-axis is the constant axis; Based on the relationship between the time after searching for any entry by the search engine where the dynamic cache is located and the number of resources obtained, draw the corresponding curve in the search analysis coordinate system, and denote it as the search efficiency curve of the storage resource amount; In the specific implementation process, in this embodiment, each storage resource amount corresponds to a search efficiency curve. Therefore, in the analysis process of step S2, there will be multiple search efficiency curves.

[0019] Step S2: Obtain the memory occupancy based on the search efficiency curve; set the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy. Step S2 includes: Step S201: Establish a rectangular coordinate system, denoted as the multi-curve screening coordinate system. Among them, the unit of the X-axis of the multi-curve screening coordinate system is time, and the Y-axis is the constant axis; put all the search efficiency curves into the multi-curve screening coordinate system, and mark the point with the maximum slope among all the search efficiency curves as the efficient search point of the search efficiency curve. In the specific implementation process, for example, in a multi-curve screening coordinate system obtained from a data analysis Figure 3 as shown in the figure, where curves SX1 to SX4 are all search efficiency curves, and line SX0 is the comprehensive efficiency line obtained based on all the search efficiency curves. Step S202: Denote the average value of the abscissas of all the efficient search points as the average efficient time; denote the line obtained by fitting all the search efficiency curves as the comprehensive efficiency line; denote the line obtained by fitting each search efficiency curve as the fitting efficiency line of the search efficiency curve. Step S203: Use the occupancy analysis algorithm to obtain the occupancy parameter of each efficient search point. The occupancy analysis algorithm is: , where F is the occupancy parameter, t is the abscissa of the efficient search point, t av is the average efficient time, k is the slope of the fitting efficiency line of the search efficiency curve where the efficient search point is located, and k av is the slope of the comprehensive efficiency line. In the specific implementation process, for example, during a data processing, the coordinates of the obtained efficient search point are (0.05 s, 100), the average efficient time is 0.1 s, the slope of the fitting efficiency line of the search efficiency curve where the efficient search point is located is 5, and the slope of the comprehensive efficiency line is 3.5. Then, through data calculation, the occupancy parameter corresponding to the efficient search point is -1.5; in this embodiment, the smaller the occupancy parameter, the smaller the abscissa of the efficient search point and the slope of the fitting efficiency line of the search efficiency curve where the efficient search point is located compared to all the efficient search points. Therefore, the efficient search point corresponding to the smallest occupancy parameter can be marked as the memory occupancy point to be used as the preferred object for subsequent analysis. Step S204: Denote the efficient search point corresponding to the smallest occupancy parameter as the memory occupancy point, and denote the storage resource amount corresponding to the memory occupancy point as the memory occupancy quantity; Denote the average value of all occupancy parameters as the measurement parameter, denote the efficient search points whose occupancy parameters are less than the measurement parameter and are not the memory occupancy point as the optional occupancy points, and denote the storage resource amounts of the optional occupancy points as the optional occupancy quantities; Step S205: Denote the memory occupancy quantity and all optional occupancy quantities as the fixed storage quantity of the dynamic cache; Denote the value obtained by subtracting the memory occupancy quantity from the total storage quantity as the memory variable quantity; Denote the values obtained by subtracting all optional occupancy quantities from the total storage quantity respectively as the optional variable quantities; Denote the memory variable quantity and all optional variable quantities as the variable storage quantity; In a specific implementation process, for example, if the total storage quantity is 1000MB, the obtained memory occupancy quantity is 100MB, and all optional occupancy quantities are 50MB, 150MB, 200MB, and 210MB respectively, then 100MB, 50MB, 150MB, 200MB, and 210MB can be denoted as the fixed storage quantity of the dynamic cache, and 900MB, 950MB, 850MB, 800MB, and 790MB can be denoted as the variable storage quantity; By obtaining the fixed storage quantity and the variable storage quantity, it is helpful to set the fixed storage space and the variable storage space in the dynamic storage during subsequent analysis to meet the preservation of the data that the user focuses on searching, and improve the user's search efficiency and search experience.

[0020] Step S3: When performing a real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage quantity, and set the variable storage space based on the searched content and the variable storage quantity; Step S3 includes: Step S301: Denote the value obtained by dividing the memory occupancy quantity by the total storage quantity as the memory occupancy ratio; Step S302: When performing a real-time search, obtain the web pages based on search jumps in real time, denote the number of times each web page is opened as the web page occupancy times of the web page, and denote the total number of times all web pages are opened as the total jump times; For any web page, when the value obtained by dividing the web page occupancy times of the web page by the total jump times is greater than the memory occupancy ratio, and the number of times the web page is opened is greater than the quantity of the fixed storage quantity, denote the web page as a fixed storage web page; In a specific implementation process, for example, during a data processing, if the memory occupancy ratio is 0.4 and the total jump times is 100 times, then the web pages whose number of times opened is greater than 40 times can be set as fixed storage web pages and stored subsequently; Step S303: When the space occupied by all fixed storage web pages is less than or equal to the memory occupancy quantity, denote all fixed storage web pages as the fixed cache content, and create a memory storage space in the dynamic cache to store the fixed cache content, where the space occupied by the memory storage space is the memory occupancy quantity; Step S304, when the space occupied by all the fixedly stored web pages is greater than the memory occupancy and less than or equal to the maximum value in the fixed storage amount, record the fixed storage amount with the smallest difference from the space occupied by all the fixedly stored web pages as the variable occupancy amount; after adjusting the space occupied by the memory storage space to the variable occupancy amount, record all the fixedly stored web pages as fixed cache content and store them in the memory storage space; In the specific implementation process, by adjusting the space occupied by the memory storage space, it helps to flexibly adjust the amount of data retained in the dynamic cache, so as to prevent the situation that when the user browses a large amount of data, the fixed storage space in the dynamic cache is relatively small and thus unable to retain the user's concerned data, thereby improving the search efficiency when the user browses a large amount of data; Step S305, when the space occupied by all the fixedly stored web pages is greater than the maximum value in the fixed storage amount, record the maximum value in the fixed storage amount as G max , adjust the space occupied by the memory storage space to G max , and sequentially store the latest obtained fixedly stored web pages in all the fixedly stored web pages into the memory storage space. When the memory storage space is full, delete the fixedly stored web pages that have not been stored in the memory storage space; Step S306, obtain in real time the fixed storage amount corresponding to the space occupied by the memory storage space and record it as the practical storage amount, and record the variable storage amount obtained based on the practical storage amount as the practical variable amount; create a variable storage space in the dynamic cache to store the latest obtained web pages, where the space occupied by the variable storage space is the practical variable amount, and whenever a new web page is opened, update the data stored in the variable storage space.

[0021] Embodiment 2, please refer to Figure 4 as shown Figure 4 illustrates a schematic structural diagram of an electronic device. The electronic device may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, it runs the steps in a dynamic cache management method for optimizing real-time search performance to achieve the following functions: First, store resources with different storage amounts in the dynamic cache and obtain the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts; then obtain the memory occupancy based on the search efficiency curve; set the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy; finally, when performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount.

[0022] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0023] Embodiment 3. This application also provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a dynamic cache management method for optimizing real-time search performance provided by the above-mentioned various methods. The method includes: First, store resources with different storage amounts in the dynamic cache, and obtain the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts; then obtain the memory occupancy based on the search efficiency curve; set the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy; finally, when performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount.

[0024] Embodiment 4. This application also provides a computer-readable storage medium. This application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, it runs the steps in a dynamic cache management method for optimizing real-time search performance as described above to achieve the following functions: First, store resources with different storage amounts in the dynamic cache, and obtain the search efficiency curve of real-time search when the dynamic cache contains resources with different storage amounts; then obtain the memory occupancy based on the search efficiency curve; set the fixed storage amount and the variable storage amount in the dynamic cache based on the memory occupancy; finally, when performing real-time search, set the fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and set the variable storage space based on the searched content and the variable storage amount.

[0025] Through the description of the above embodiments, the embodiments of the present invention can be provided as a method, a system or a computer program product. Based on such an understanding, the above technical solution, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0026] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The above-described embodiments are merely illustrative. For example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.

[0027] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present application.

Claims

1. A dynamic cache management method for optimizing real-time search performance, characterized in that: The steps include: Storing resources with different storage amounts in the dynamic cache, and obtaining a search efficiency curve of a real-time search when the dynamic cache contains resources with different storage amounts; Obtain memory usage based on the search efficiency curve; set fixed storage and variable storage in the dynamic cache based on the memory usage; When searching in real time, fixed cache content is set in the dynamic cache based on the searched content and the fixed storage amount, and variable storage space is set based on the searched content and the variable storage amount.

2. A dynamic cache management method for optimizing real-time search performance according to claim 1, characterized in that: The search efficiency curves of real-time search when resources with different storage amounts are stored in the dynamic cache and the dynamic cache contains resources with different storage amounts include: The total amount of resources that can be stored in the dynamic cache is recorded as the total storage capacity; multiple data that can be stored in the dynamic cache are obtained, and based on the size of the resource space occupied by each data, they are recorded in order from small to large as storable data KC1 to storable data KC n , where data KC can be stored n The resource space occupied is less than or equal to the total storage capacity; Get storable data KC1 to storable data KC n All combinations that can be stored in the dynamic cache are recorded as storage combinations; the size of the resource space occupied by all storable data KC in each storage combination is recorded as the combined occupied space of the storage combination; Based on the size of the combined space occupied by all storage combinations, all storage combinations are recorded in order from small to large as storage combination CZ1 to storage combination CZ m ; The dynamic storage analysis method is used to obtain the storage resource amount corresponding to the combined occupied space of all storage combinations CZ, and obtain the search efficiency curve corresponding to each storage resource amount.

3. A dynamic cache management method for optimizing real-time search performance according to claim 2, characterized in that: Dynamic storage analysis methods include: Establish a plane rectangular coordinate system, recorded as the occupancy analysis coordinate system, where the unit of the Y axis of the occupancy analysis coordinate system is byte, and the coordinate points from the coordinate origin to the right in the X axis are filled with storable data KC1 to storable data KC n ; For any storable data KC, the coordinate point corresponding to X=storable data KC, Y=the size of the resource space occupied by the storable data KC is recorded as the occupied point of the storable data KC; Obtain the occupied points corresponding to all storable data KC, and record the curve obtained by fitting all occupied points as the occupancy analysis curve; n The size of the resource space occupied is recorded as Y0, and the vertical coordinate of the point with the largest slope from Y=0 to Y=Y0 / 2 in the occupancy analysis curve is marked as Y min .

4. A dynamic cache management method for optimizing real-time search performance according to claim 3, characterized in that: Dynamic storage analysis also includes: The storage combinations CZ1 to CZ1 that do not contain storage resources are sequentially m The combined fusion method is used for analysis; the combined fusion method is: the storage combination CZ to be analyzed is recorded as the storage combination CZ c , where c is a positive integer less than or equal to m and greater than or equal to 1; store the combination CZ c The combined space occupied by is recorded as Y1, and [Y1-Y min ,Y1+Y min ] is recorded as storage combination CZ c The fusion interval; When removing the storage combination CZ c Any storage combination CZ other than the combined space occupied by the storage combination CZ c When the fusion interval is within the storage combination CZ, the combined space is c Within the fusion range and except for storage combination CZ c Storage combinations other than CZ are recorded as storage combination CZ c The combination to be merged; store the combination CZ c The average of the space occupied by the combination of and all the combined spaces occupied by the combinations to be fused is recorded as the storage combination CZ c With storage combination CZ c The storage resource amount of all combinations to be merged.

5. A dynamic cache management method for optimizing real-time search performance according to claim 4, characterized in that: Dynamic storage analysis also includes: When removing the storage combination CZ c All storage combinations other than CZ are not in storage combination CZ. c When the fusion interval is within the range, the storage combination CZ c The space occupied by the combination is recorded as storage combination CZ c The amount of storage resources; The storage resource amount of all storage combinations CZ is obtained based on the combination fusion method.

6. A dynamic cache management method for optimizing real-time search performance according to claim 5, characterized in that: Dynamic storage analysis also includes: For any storage resource amount, data of a size equal to the storage resource amount is stored in the dynamic cache, and any term is searched using the search engine where the dynamic cache is located; a plane rectangular coordinate system is established, recorded as the search analysis coordinate system, wherein the unit of the X-axis of the search analysis coordinate system is time, and the Y-axis is a constant axis; based on the relationship between the time after searching for any term with the search engine where the dynamic cache is located and the number of resources obtained by the search, a corresponding curve is drawn in the search analysis coordinate system, and recorded as the search efficiency curve of the storage resource amount.

7. A dynamic cache management method for optimizing real-time search performance according to claim 6, characterized in that: Get memory usage based on the search efficiency curve; Setting the fixed storage amount and variable storage amount in the dynamic cache based on memory usage includes: Establish a plane rectangular coordinate system, recorded as a multi-curve screening coordinate system, wherein the unit of the X-axis of the multi-curve screening coordinate system is time, and the Y-axis is a constant axis; put all search efficiency curves in the multi-curve screening coordinate system, and record the point where the maximum value of the slope of all search efficiency curves is located as the efficient search point of the search efficiency curve; The average value of the horizontal coordinates of all efficient search points is recorded as the average efficient time; the straight line obtained by fitting all search efficiency curves is recorded as the comprehensive efficiency straight line; the straight line obtained by fitting each search efficiency curve is recorded as the fitted efficiency straight line of the search efficiency curve; Use the occupancy analysis algorithm to obtain the occupancy parameters of each efficient search point. The occupancy analysis algorithm is: , where F is the occupancy parameter, t is the horizontal coordinate of the efficient search point, and t av is the average efficient time, k is the slope of the fitted efficiency line of the search efficiency curve where the efficient search point is located, and k av is the slope of the overall efficiency line.

8. A dynamic cache management method for optimizing real-time search performance according to claim 7, characterized in that: Get memory usage based on the search efficiency curve; Setting the fixed storage amount and variable storage amount in the dynamic cache based on memory usage also includes: The efficient search point corresponding to the minimum occupation parameter is recorded as the memory occupation point, and the storage resource amount corresponding to the memory occupation point is recorded as the memory occupation amount; the average value of all occupation parameters is recorded as the measurement parameter, the efficient search point whose occupation parameter is less than the measurement parameter and is not a memory occupation point is recorded as an optional occupation point, and the storage resource amount of the optional occupation point is recorded as the optional occupation amount; The memory usage and all optional usage are recorded as the fixed storage capacity of the dynamic cache; the value of the total storage capacity minus the memory usage is recorded as the variable memory capacity; the value of the total storage capacity minus all optional usage is recorded as the optional variable capacity; the memory variable capacity and all optional variable capacities are recorded as the variable storage capacity.

9. A dynamic cache management method for optimizing real-time search performance according to claim 8, characterized in that: When searching in real time, setting fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and setting variable storage space based on the searched content and the variable storage amount include: The value of dividing the memory usage by the total storage capacity is recorded as the memory usage ratio; When searching in real time, web pages that are redirected based on the search are obtained in real time, and the number of times each web page is opened is recorded as the web page occupancy count of the web page, and the number of times all web pages are opened is recorded as the total number of jumps; for any web page, when the value of the web page occupancy count divided by the total number of jumps is greater than the memory occupancy ratio, and the number of times the web page is opened is greater than the fixed storage capacity, the web page is recorded as a persistently stored web page.

10. A dynamic cache management method for optimizing real-time search performance according to claim 9, characterized in that: When searching in real time, setting fixed cache content in the dynamic cache based on the searched content and the fixed storage amount, and setting variable storage space based on the searched content and the variable storage amount also includes: When the space occupied by all the permanently stored web pages is less than or equal to the memory usage, all the permanently stored web pages are recorded as fixed cache content, and a memory storage space is created in the dynamic cache to store the fixed cache content, wherein the space occupied by the memory storage space is the memory usage; When the space occupied by all permanently stored web pages is greater than the memory usage and less than or equal to the maximum value of the fixed storage, the fixed storage with the smallest difference between the space occupied by all permanently stored web pages and the fixed storage is recorded as the variable usage; after the space occupied by the memory storage space is adjusted to the variable usage, all permanently stored web pages are recorded as fixed cache content and stored in the memory storage space; When the space occupied by all stored web pages is greater than the maximum value in the fixed storage, the maximum value in the fixed storage is recorded as G max , the memory storage space is adjusted to G max , and storing the latest stored web pages among all the stored web pages in the memory storage space in sequence, and when the memory storage space is full, deleting the stored web pages that are not stored in the memory storage space; The fixed storage amount corresponding to the space occupied by the memory storage space is obtained in real time and recorded as the practical storage amount, and the variable storage amount obtained based on the practical storage amount is recorded as the practical variable amount; a variable storage space is created in the dynamic cache to store the latest acquired web pages, wherein the space occupied by the variable storage space is the practical variable amount, and each time a new web page is opened, the data stored in the variable storage space is updated.

Citation Information

Patent Citations

  • Multi-channel dynamic cache management method, system, equipment and medium

    CN118656313A

  • Optimization method and optimization system for memory access in multi-core system

    CN101719105A

  • Data transmission control method and device and storage medium

    CN110022268A

  • Cache system, cache processing method and device, equipment and medium

    CN111737168A

  • Storage optimization method for dynamic heterogeneous adjustment in industrial data cache

    CN118349174A