Web end resource adaptive cache optimization method and system
By monitoring user access requests and adjusting the access allocation time interval and resource push queue of the cache space, the problems of cache inconsistency and cache breakdown were solved, the cache hit rate and data access reliability were improved, and the system was ensured to operate stably.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIZHIAN INFORMATION TECH CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-15
AI Technical Summary
In computer systems, cache inconsistency and cache breakdown problems lead to decreased system performance, affecting data access reliability and normal system operation.
By listening to user access requests, determining the number of valid user accesses, adjusting the access allocation time interval and resource push queue of the cache space, setting the cache time, and listening for access failure events to adjust the cache update status, we can ensure cache data consistency and hit rate.
Effectively avoid cache breakdown, improve cache hit rate and data access reliability, and ensure normal system operation.
Smart Images

Figure CN122053699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage management, and more particularly to a method and system for adaptive caching optimization of web resources. Background Technology
[0002] Caching (buffered storage) is widely used in computer systems employing hierarchical storage structures, providing a reliable and stable storage mechanism for system operation. Within the same system, when many different devices share a single buffered storage resource, data inconsistency in the cache can lead to cache inconsistency problems. Furthermore, when user access volume is high, cache invalidation can occur, resulting in cache breakdown. In this case, all accesses will directly reach the database, placing immense pressure on it, potentially even crashing it, and causing excessive load on the server, impacting normal system operation. Therefore, improving cache hit rate and preventing cache invalidation while ensuring cache data consistency is crucial for maintaining normal and continuous system operation and enhancing the reliability of data access. Summary of the Invention
[0003] The purpose of this invention is to provide a web-based resource adaptive caching optimization method and system. Based on user access requests received from the web client, the effective user access volume is determined, thereby determining the access allocation time interval for all users to the web client's cache space. This avoids a large number of accesses impacting the cache space in a short period, preventing cache breakdown. Based on the resource change characteristics of the corresponding database on the web client, the resource push queue from the database to the cache space is adjusted. Combined with the access allocation time interval, the caching time of resources in the cache space is set to ensure cache data consistency and cache hit rate, improving the reliability of data access to the cache space. Based on user access information in the cache space, it is determined whether an access failure event has occurred in the cache space, thereby adjusting the data update status of the cache space. By improving the cache update method, the efficiency of the cache in responding to access is improved, ensuring the normal and continuous operation of the system and improving the reliability of data access to the system.
[0004] This invention is achieved through the following technical solution:
[0005] Web-based resource adaptive caching optimization methods include:
[0006] Listen for user access requests received by the web client, and determine the effective user access volume received by the web client based on the user access requests; determine the access allocation time interval for all users to the cache space of the web client based on the effective user access volume.
[0007] Based on the resource change characteristics of the corresponding database on the web client, the resource push queue of the database to the cache space is adjusted; based on the access allocation time interval, the caching time of the resources in the resource push queue in the cache space is set.
[0008] Monitor user access information in the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly.
[0009] Optionally, the system monitors user access requests received by the web application, determines the effective user access volume received by the web application based on the user access requests, and determines the access allocation time interval for all users' access to the web application's cache space based on the effective user access volume, including:
[0010] All network links connected to the web client are monitored to obtain all user access requests from the web client within the corresponding time interval; each user access request is parsed and processed to obtain the identity of the initiating user and the type of the target resource; based on the initiating user identity and the type of the target resource, it is determined whether the user access request is a valid user access request, and all valid user access requests are integrated into a valid user access count.
[0011] Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the access allocation time interval for each user to the cache space on the web client.
[0012] Optionally, based on the resource change characteristics of the database corresponding to the web client, the resource push queue from the database to the cache space is adjusted; based on the access allocation time interval, the caching time of the resources in the resource push queue in the cache space is set, including:
[0013] Based on the resource change log of the database corresponding to the web client, the resource change characteristics of the database during the period when the web client receives user access requests are determined; wherein, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database; based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby covering the original resource push queue of the cache space.
[0014] Based on the access allocation time interval and the respective access target resource types of all users, the caching time of all resources in the cache space is set for the resources pushed into the queue; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
[0015] Optionally, the caching time for all resources pushed into the queue in the cache space is set, including:
[0016] Retrieve the access allocation time intervals from the historical access process of each user for each resource;
[0017] Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access;
[0018] A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource;
[0019] The reference value for the overlap time length is obtained by the following formula:
[0020]
[0021] Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T ei T represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource;
[0022] The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold;
[0023] The cache duration adjustment coefficient is obtained using the following formula:
[0024]
[0025] Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.7.
[0026] Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space;
[0027] The caching time for each resource in the cache space is obtained using the following formula:
[0028]
[0029] Among them, T c T represents the caching time for each resource within the cache space; b K represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
[0030] Optionally, monitoring user access information of the cache space to determine whether an access failure event has occurred in the cache space, and adjusting the data update status of the cache space accordingly, including:
[0031] Monitor the data reading records of each corresponding user's access to the cache space, and generate access result information for each corresponding user to the cache space based on the data reading records; wherein, the access result information includes the integrity information of the data read by the corresponding user from the cache space;
[0032] Based on the access result information, it is determined whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, the cache data is updated in the next working cycle of the cache space based on the type of the target resource accessed by the corresponding user.
[0033] A web-based resource adaptive caching optimization system, including:
[0034] The effective user access determination module is used to listen to user access requests received by the web client and determine the effective user access volume received by the web client based on the user access requests.
[0035] The access allocation time interval determination module is used to determine the access allocation time interval for all users to the cache space of the web terminal based on the effective user access volume.
[0036] The resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web client.
[0037] The cache time setting module is used to set the cache time of the resources in the resource push queue in the cache space based on the access allocation time interval;
[0038] The cache space data update and adjustment module is used to monitor user access information of the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly.
[0039] Optionally, the effective user access determination module is used to monitor user access requests received by the web client, and determine the number of effective user accesses received by the web client based on the user access requests, including:
[0040] All network links connected to the web client are monitored to obtain all user access requests from the web client within the corresponding time interval; each user access request is parsed and processed to obtain the identity of the initiating user and the type of the target resource; based on the initiating user identity and the type of the target resource, it is determined whether the user access request is a valid user access request, and all valid user access requests are integrated into a valid user access count.
[0041] The access allocation time interval determination module is used to determine the access allocation time interval for all users to the web-side cache space based on the effective user access volume, including:
[0042] Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the access allocation time interval for each user to the cache space on the web client.
[0043] Optionally, the resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web client, including:
[0044] Based on the resource change log of the database corresponding to the web client, the resource change characteristics of the database during the period when the web client receives user access requests are determined; wherein, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database; based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby covering the original resource push queue of the cache space.
[0045] The cache time setting module is used to set the cache time of resources in the resource push queue in the cache space based on the access allocation time interval, including:
[0046] Based on the access allocation time interval and the respective access target resource types of all users, the caching time of all resources in the cache space is set for the resources pushed into the queue; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
[0047] Optionally, the caching time for all resources pushed into the queue in the cache space is set, including:
[0048] Retrieve the access allocation time intervals from the historical access process of each user for each resource;
[0049] Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access;
[0050] A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource;
[0051] The reference value for the overlap time length is obtained by the following formula:
[0052]
[0053] Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T ei T represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource;
[0054] The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold;
[0055] The cache duration adjustment coefficient is obtained using the following formula:
[0056]
[0057] Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.7.
[0058] Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space;
[0059] The caching time for each resource in the cache space is obtained using the following formula:
[0060]
[0061] Among them, T c T represents the caching time for each resource within the cache space; bK represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
[0062] Optionally, the cache space data update and adjustment module is used to monitor user access information of the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly, including:
[0063] Monitor the data reading records of each corresponding user's access to the cache space, and generate access result information for each corresponding user to the cache space based on the data reading records; wherein, the access result information includes the integrity information of the data read by the corresponding user from the cache space;
[0064] Based on the access result information, it is determined whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, the cache data is updated in the next working cycle of the cache space based on the type of the target resource accessed by the corresponding user.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] The web-based resource adaptive caching optimization method and system provided in this application determine the effective user access volume based on user access requests received from the web client. This determines the access allocation time interval for all users to the web client's cache space, avoiding a large number of accesses impacting the cache space in a short period and preventing cache breakdown. Based on the resource change characteristics of the corresponding database on the web client, the resource push queue from the database to the cache space is adjusted. Combined with the access allocation time interval, the caching time of resources in the cache space is set to ensure cache data consistency and cache hit rate, improving the data access reliability of the cache space. Based on user access information in the cache space, it is determined whether an access failure event has occurred in the cache space. This is used to adjust the data update status of the cache space. By improving the cache update method, the efficiency of the cache in responding to access is improved, ensuring the normal and continuous operation of the system and improving the data access reliability of the system. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0068] Figure 1 This is a flowchart illustrating the adaptive caching optimization method for web resources provided by the present invention.
[0069] Figure 2 This is a schematic diagram of the structure of the web-based resource adaptive caching optimization system provided by the present invention. Detailed Implementation
[0070] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not the entire structure. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.
[0071] The terms “comprising” and “having”, and any variations thereof, used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0072] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0073] Please see Figure 1 As shown, an embodiment of this application provides a web-based resource adaptive caching optimization method. This web-based resource adaptive caching optimization method includes:
[0074] Listen for user access requests received by the web client, determine the number of valid user accesses received by the web client based on the user access requests, and determine the time interval for all users to access the cache space of the web client based on the number of valid user accesses.
[0075] Based on the resource change characteristics of the corresponding database on the web side, adjust the resource push queue from the database to the cache space; based on the access allocation time interval, set the caching time of resources in the resource push queue in the cache space.
[0076] Monitor user access information in the cache space to determine if an access failure event has occurred, and adjust the data update status of the cache space accordingly.
[0077] The beneficial effects of the above embodiments are as follows: This web-based resource adaptive caching optimization method determines the effective user access volume based on user access requests received by the web client, thereby determining the access allocation time interval for all users to the web client's cache space, avoiding a large number of accesses impacting the cache space in a short period of time, and preventing cache breakdown; based on the resource change characteristics of the corresponding database on the web client, it adjusts the resource push queue from the database to the cache space, and sets the caching time of resources in the cache space in combination with the access allocation time interval, ensuring cache data consistency and cache hit rate, and improving the data access reliability of the cache space; based on user access information in the cache space, it determines whether an access failure event has occurred in the cache space, thereby adjusting the data update status of the cache space, improving the efficiency of cache in responding to access by improving the cache update method, ensuring the normal and continuous operation of the system, and improving the data access reliability of the system.
[0078] In another embodiment, user access requests received by the web client are monitored, and based on the user access requests, the number of valid user accesses received by the web client is determined; based on the number of valid user accesses, the time interval for all users to access the cache space of the web client is determined, including:
[0079] Listen to all network links connected to the web client to obtain all user access requests from the web client within the corresponding time interval; parse and process each user access request to obtain the identity of the user who initiated the access request and the type of the target resource; based on the identity of the user who initiated the access request and the type of the target resource, determine whether the user access request is a valid user access request, and integrate all valid user access requests into valid user access volume.
[0080] Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the time interval for all users to access the web cache space.
[0081] The beneficial effects of the above embodiments are that the web client, as the target terminal for access by different external users, is connected to a database and can provide different data for user access and queries. The web client is connected to the network, and different external users can access the web client through different network links. Different users have different resource data needs for accessing and querying the web client. To meet the resource data access needs of different users and ensure that the corresponding cache space on the web client stores the corresponding resource data, all network links connected to the web client are first monitored to obtain all user access requests received by the web client within the corresponding time interval. Then, each user access request is parsed to obtain the identity of the initiating user and the type of the target resource. The initiating user's identity is compared with a preset identity whitelist, and the target resource type is compared with the resource type list stored in the web client's database. If the initiating user's identity exists in the preset identity whitelist and the target resource type exists in the resource type list, then the user access request is determined to be a valid user access request; otherwise, the user access request is determined to be an invalid user access request. This allows for user access filtering and interception at the web client's access receiving layer, preventing invalid user access from impacting the web client. Furthermore, based on the number of valid user accesses, the expected response time interval for each valid user access request is determined. This means that after each valid user access request accesses the web client, the expected response time interval is determined. Then, based on the expected response time interval, the access allocation time interval for the web client's cache space for all users corresponding to all valid user access requests is determined. This ensures that all users corresponding to all valid user access requests can exclusively enjoy access to the cache space within a specific time interval, avoiding access conflicts between different users to the cache space.
[0082] In another embodiment, based on the resource change characteristics of the corresponding database on the web client, the resource push queue from the database to the cache space is adjusted; based on the access allocation time interval, the caching time of resources in the resource push queue in the cache space is set, including:
[0083] Based on the resource change logs of the corresponding database on the web side, the resource change characteristics of the database during the period when the database receives user access requests on the web side are determined. Among them, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database. Based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby overwriting the original resource push queue in the cache space.
[0084] Based on the access allocation time interval and the access target resource type of each user, the caching time of all resources pushed into the queue in the cache space is set; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
[0085] The beneficial effects of the above embodiments are as follows: the web client connects to a database that stores different types of resource data, and the resource data within the database is subject to updates and changes, such as the addition or deletion of different types of resource data. Different users accessing the web client expect to access and query different types of resource data. Users do not directly access the database but instead access the cache space. To meet the resource data access needs of different users, corresponding resources need to be selected from the database to form a resource push queue, and this queue is then pushed to the cache space. If the resource types in the push queue do not match the user's access needs, the cache hit rate will decrease, causing the user to re-access the cache space after the initial failure, increasing the cache space's access load. Therefore, the web client determines the types and quantities of newly added and deleted resource data within the period during which the database receives user access requests from the web client based on the database's resource change log. This allows for the selection of several latest resources matching these resource types to form a resource push queue, which then overwrites the original resource push queue in the cache space, ensuring that the resource data stored in the cache space meets the user's access needs. Furthermore, based on the aforementioned access allocation time interval and the target resource types of each user's access to the cache space, the caching time of all resources in the resource push queue in the cache space is set, so that the overlap time between the caching time of each resource in the cache space and the access allocation time interval of the corresponding user is not less than a preset time length threshold, ensuring that the caching duration of each resource in the cache space is long enough to facilitate users to access and query the resources they need.
[0086] In another embodiment, setting the caching time for all resources in the cache space pushed to the queue includes:
[0087] Retrieve the access allocation time intervals from the historical access process of each user for each resource;
[0088] Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access;
[0089] A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource;
[0090] The reference value for the overlap time length is obtained by the following formula:
[0091]
[0092] Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T eiT represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource;
[0093] The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold;
[0094] The cache duration adjustment coefficient is obtained using the following formula:
[0095]
[0096] Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.7.
[0097] Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space;
[0098] The caching time for each resource in the cache space is obtained using the following formula:
[0099]
[0100] Among them, T c T represents the caching time for each resource within the cache space; b K represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
[0101] The beneficial effects of the above embodiments are that they integrate multi-dimensional historical data such as user historical access allocation time intervals, average single access durations, and overlapping time length reference values, and combine them with resource weights and type influence coefficients to construct a quantitative calculation system. This ensures that cache time settings are deeply matched with actual resource access patterns and their own attributes, avoiding cache time deviations caused by single dimensions or subjective settings, and improving the targeting and accuracy of cache time. The overlapping time length reference value reflects the temporal correlation of resource access, and the cache time is dynamically adjusted in conjunction with preset thresholds and influence coefficients. This avoids wasting cache space due to excessively long cache times and reduces frequent resource reloading due to excessively short cache times, achieving a balance between efficient cache space allocation and resource access response speed. Differential calculations are performed on user historical access characteristics such as access time intervals and duration proportions for each resource, while incorporating resource weights and type influence coefficients. This allows cache time settings to adapt to the access frequency, importance, and type characteristics of different resources, meeting the caching needs of diverse resources and improving the personalized adaptation level of caching strategies. By pre-setting adjustable parameters such as time length thresholds, time overlap impact coefficients, and resource type impact coefficients, a flexible cache time adjustment mechanism is constructed. This allows for dynamic optimization of parameter configurations based on actual application scenarios, system resource conditions, or business needs, enhancing the adaptability and scalability of the caching strategy across different environments. A systematic cache time setting process is built based on standardized mathematical formulas (overlap time reference values, adjustment coefficients, and cache time calculations), replacing subjective experience-based judgments. This ensures that caching decisions have rigorous data support and reproducibility, improving the stability and reliability of the caching strategy.
[0102] In another embodiment, monitoring user access information of the cache space and determining whether an access failure event has occurred in the cache space are used to adjust the data update status of the cache space, including:
[0103] Monitor the data read records of each corresponding user's access to the cache space, and generate access result information for each corresponding user's access to the cache space based on the data read records; the access result information includes the completeness information of the data read by the corresponding user from the cache space;
[0104] Based on the access result information, determine whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, update the cache data in the cache space in the next working cycle based on the type of the target resource accessed by the corresponding user.
[0105] The beneficial effects of the above embodiments are as follows: considering that the caching time of each resource in the cache space is limited, and the overlap time between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold, if the user's data read rate is low within the corresponding cache time of the resource, it will be impossible to guarantee that the user can completely read the required resource, resulting in the user's data read failure in the cache space. If the user experiences a data read failure, it indicates that the user cannot correctly access the required resource. In order to enable users who have failed to access resources to successfully access and query the required resource from the cache space again in subsequent processes, the data read records of each corresponding user's access to the cache space are monitored and analyzed to determine the data integrity information read by the user from the cache space. If the data integrity information indicates that the user has not completely read the required resource, it is determined that the user has experienced a cache space access failure event; otherwise, it is determined that the user has experienced a cache space access failure event. When an access failure event occurs to the cache space, the cache data is updated in the next working cycle based on the type of the target resource accessed by the corresponding user. For example, the cache data update in the next working cycle may re-store the resources that the corresponding user did not fully read last time into the cache space. By improving the cache update method, the efficiency of the cache in handling access is improved, ensuring the normal and continuous operation of the system and improving the reliability of data access to the system.
[0106] Please see Figure 2 As shown, an embodiment of this application provides a web-based resource adaptive caching optimization system. This web-based resource adaptive caching optimization system includes:
[0107] The effective user access determination module is used to listen for user access requests received by the web client and determine the number of effective user accesses received by the web client based on the user access requests.
[0108] The access allocation time interval determination module is used to determine the access allocation time interval for all users to the web cache space based on the effective user access volume.
[0109] The resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web side.
[0110] The cache time setting module is used to set the cache time of resources in the resource push queue in the cache space based on the access allocation time interval;
[0111] The cache space data update and adjustment module is used to monitor user access information in the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly.
[0112] The beneficial effects of the above embodiments are as follows: This web-based resource adaptive caching optimization system determines the effective user access volume based on user access requests received from the web client, thereby determining the access allocation time interval for all users to the web client's cache space. This avoids a large number of accesses impacting the cache space in a short period of time, preventing cache breakdown. Based on the resource change characteristics of the corresponding database on the web client, the system adjusts the resource push queue from the database to the cache space and, combined with the access allocation time interval, sets the caching time of resources in the cache space, ensuring cache data consistency and cache hit rate, and improving the data access reliability of the cache space. Based on user access information in the cache space, the system determines whether an access failure event has occurred in the cache space, thereby adjusting the data update status of the cache space. By improving the cache update method, the system improves the efficiency of the cache in responding to accesses, ensuring the normal and continuous operation of the system and improving the data access reliability of the system.
[0113] In another embodiment, the effective user access determination module is used to listen for user access requests received by the web client, and determine the number of effective user accesses received by the web client based on the user access requests, including:
[0114] Listen to all network links connected to the web client to obtain all user access requests from the web client within the corresponding time interval; parse and process each user access request to obtain the identity of the user who initiated the access request and the type of the target resource; based on the identity of the user who initiated the access request and the type of the target resource, determine whether the user access request is a valid user access request, and integrate all valid user access requests into valid user access volume.
[0115] The access allocation time interval determination module is used to determine the access allocation time interval for all users' access to the web-side cache space based on the effective user access volume, including:
[0116] Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the time interval for all users to access the web cache space.
[0117] The beneficial effects of the above embodiments are that the web client, as the target terminal for access by different external users, is connected to a database and can provide different data for user access and queries. The web client is connected to the network, and different external users can access the web client through different network links. Different users have different resource data needs for accessing and querying the web client. To meet the resource data access needs of different users and ensure that the corresponding cache space on the web client stores the corresponding resource data, all network links connected to the web client are first monitored to obtain all user access requests received by the web client within the corresponding time interval. Then, each user access request is parsed to obtain the identity of the initiating user and the type of the target resource. The initiating user's identity is compared with a preset identity whitelist, and the target resource type is compared with the resource type list stored in the web client's database. If the initiating user's identity exists in the preset identity whitelist and the target resource type exists in the resource type list, then the user access request is determined to be a valid user access request; otherwise, the user access request is determined to be an invalid user access request. This allows for user access filtering and interception at the web client's access receiving layer, preventing invalid user access from impacting the web client. Furthermore, based on the number of valid user accesses, the expected response time interval for each valid user access request is determined. This means that after each valid user access request accesses the web client, the expected response time interval is determined. Then, based on the expected response time interval, the access allocation time interval for the web client's cache space for all users corresponding to all valid user access requests is determined. This ensures that all users corresponding to all valid user access requests can exclusively enjoy access to the cache space within a specific time interval, avoiding access conflicts between different users to the cache space.
[0118] In another embodiment, the resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web client, including:
[0119] Based on the resource change logs of the corresponding database on the web side, the resource change characteristics of the database during the period when the database receives user access requests on the web side are determined. Among them, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database. Based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby overwriting the original resource push queue in the cache space.
[0120] The cache time setting module is used to set the cache time of resources in the resource push queue in the cache space based on the access allocation time interval, including:
[0121] Based on the access allocation time interval and the access target resource type of each user, the caching time of all resources pushed into the queue in the cache space is set; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
[0122] The beneficial effects of the above embodiments are as follows: the web client connects to a database that stores different types of resource data, and the resource data within the database is subject to updates and changes, such as the addition or deletion of different types of resource data. Different users accessing the web client expect to access and query different types of resource data. Users do not directly access the database but instead access the cache space. To meet the resource data access needs of different users, corresponding resources need to be selected from the database to form a resource push queue, and this queue is then pushed to the cache space. If the resource types in the push queue do not match the user's access needs, the cache hit rate will decrease, causing the user to re-access the cache space after the initial failure, increasing the cache space's access load. Therefore, the web client determines the types and quantities of newly added and deleted resource data within the period during which the database receives user access requests from the web client based on the database's resource change log. This allows for the selection of several latest resources matching these resource types to form a resource push queue, which then overwrites the original resource push queue in the cache space, ensuring that the resource data stored in the cache space meets the user's access needs. Furthermore, based on the aforementioned access allocation time interval and the target resource types of each user's access to the cache space, the caching time of all resources in the resource push queue in the cache space is set, so that the overlap time between the caching time of each resource in the cache space and the access allocation time interval of the corresponding user is not less than a preset time length threshold, ensuring that the caching duration of each resource in the cache space is long enough to facilitate users to access and query the resources they need.
[0123] In another embodiment, setting the caching time for all resources in the cache space pushed to the queue includes:
[0124] Retrieve the access allocation time intervals from the historical access process of each user for each resource;
[0125] Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access;
[0126] A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource;
[0127] The reference value for the overlap time length is obtained by the following formula:
[0128]
[0129] Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T ei T represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource;
[0130] The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold;
[0131] The cache duration adjustment coefficient is obtained using the following formula:
[0132]
[0133] Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.7.
[0134] Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space;
[0135] The caching time for each resource in the cache space is obtained using the following formula:
[0136]
[0137] Among them, T c T represents the caching time for each resource within the cache space; b K represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
[0138] The beneficial effects of the above embodiments are that they integrate multi-dimensional historical data such as user historical access allocation time intervals, average single access durations, and overlapping time length reference values, and combine them with resource weights and type influence coefficients to construct a quantitative calculation system. This ensures that cache time settings are deeply matched with actual resource access patterns and their own attributes, avoiding cache time deviations caused by single dimensions or subjective settings, and improving the targeting and accuracy of cache time. The overlapping time length reference value reflects the temporal correlation of resource access, and the cache time is dynamically adjusted in conjunction with preset thresholds and influence coefficients. This avoids wasting cache space due to excessively long cache times and reduces frequent resource reloading due to excessively short cache times, achieving a balance between efficient cache space allocation and resource access response speed. Differential calculations are performed on user historical access characteristics such as access time intervals and duration proportions for each resource, while incorporating resource weights and type influence coefficients. This allows cache time settings to adapt to the access frequency, importance, and type characteristics of different resources, meeting the caching needs of diverse resources and improving the personalized adaptation level of caching strategies. By pre-setting adjustable parameters such as time length thresholds, time overlap impact coefficients, and resource type impact coefficients, a flexible cache time adjustment mechanism is constructed. This allows for dynamic optimization of parameter configurations based on actual application scenarios, system resource conditions, or business needs, enhancing the adaptability and scalability of the caching strategy across different environments. A systematic cache time setting process is built based on standardized mathematical formulas (overlap time reference values, adjustment coefficients, and cache time calculations), replacing subjective experience-based judgments. This ensures that caching decisions have rigorous data support and reproducibility, improving the stability and reliability of the caching strategy.
[0139] In another embodiment, the cache space data update and adjustment module is used to monitor user access information of the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly, including:
[0140] Monitor the data read records of each corresponding user's access to the cache space, and generate access result information for each corresponding user's access to the cache space based on the data read records; the access result information includes the completeness information of the data read by the corresponding user from the cache space;
[0141] Based on the access result information, determine whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, update the cache data in the cache space in the next working cycle based on the type of the target resource accessed by the corresponding user.
[0142] The beneficial effects of the above embodiments are as follows: considering that the caching time of each resource in the cache space is limited, and the overlap time between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold, if the user's data read rate is low within the corresponding cache time of the resource, it will be impossible to guarantee that the user can completely read the required resource, resulting in the user's data read failure in the cache space. If the user experiences a data read failure, it indicates that the user cannot correctly access the required resource. In order to enable users who have failed to access resources to successfully access and query the required resource from the cache space again in subsequent processes, the data read records of each corresponding user's access to the cache space are monitored and analyzed to determine the data integrity information read by the user from the cache space. If the data integrity information indicates that the user has not completely read the required resource, it is determined that the user has experienced a cache space access failure event; otherwise, it is determined that the user has experienced a cache space access failure event. When an access failure event occurs to the cache space, the cache data is updated in the next working cycle based on the type of the target resource accessed by the corresponding user. For example, the cache data update in the next working cycle may re-store the resources that the corresponding user did not fully read last time into the cache space. By improving the cache update method, the efficiency of the cache in handling access is improved, ensuring the normal and continuous operation of the system and improving the reliability of data access to the system.
[0143] Overall, this web-based resource adaptive caching optimization method and system determines the effective user access volume based on user access requests received from the web client. This determines the time interval for all users to access the web client's cache space, avoiding a surge of accesses within a short period and preventing cache breakdown. Based on the resource change characteristics of the corresponding database on the web client, the system adjusts the resource push queue from the database to the cache space. Combined with the access allocation time interval, it sets the caching time for resources in the cache space, ensuring cache data consistency and cache hit rate, and improving the reliability of data access to the cache space. Based on user access information in the cache space, it determines whether access failure events have occurred, adjusting the data update status of the cache space accordingly. By improving the cache update method, it enhances the efficiency of cache response to access, ensuring the normal and continuous operation of the system and improving the reliability of data access to the system.
[0144] The above is only one specific embodiment of the present invention, and any improvements made based on the concept of the present invention shall be considered within the scope of protection of the present invention.
Claims
1. A web-based resource adaptive caching optimization method, characterized in that, include: Listen for user access requests received on the web client, and determine the number of valid user accesses received on the web client based on the user access requests. Based on the effective user access volume, determine the access allocation time interval for all users to the cache space of the web terminal; Based on the resource change characteristics of the corresponding database on the web client, adjust the resource push queue from the database to the cache space; Based on the access allocation time interval, the caching time of the resources in the resource push queue in the cache space is set; Monitor user access information in the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly.
2. The web-based resource adaptive caching optimization method as described in claim 1, characterized in that: Listen for user access requests received on the web client, and determine the number of valid user accesses received on the web client based on the user access requests. Based on the effective user access volume, determine the corresponding time interval for all users to access the cache space of the web client, including: All network links connected to the web client are monitored to obtain all user access requests from the web client within the corresponding time interval; each user access request is parsed and processed to obtain the identity of the initiating user and the type of the target resource; based on the initiating user identity and the type of the target resource, it is determined whether the user access request is a valid user access request, and all valid user access requests are integrated into a valid user access count. Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the access allocation time interval for each user to the cache space on the web client.
3. The web-based resource adaptive caching optimization method as described in claim 1, characterized in that: Based on the resource change characteristics of the corresponding database on the web client, adjust the resource push queue from the database to the cache space; Based on the access allocation time interval, the caching time of resources in the resource push queue in the cache space is set, including: Based on the resource change log of the database corresponding to the web client, the resource change characteristics of the database during the period when the web client receives user access requests are determined; wherein, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database; based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby covering the original resource push queue of the cache space. Based on the access allocation time interval and the respective access target resource types of all users, the caching time of all resources in the cache space is set for the resources pushed into the queue; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
4. The web-based resource adaptive caching optimization method as described in claim 3, characterized in that: The cache time for all resources in the cache space pushed to the queue is set, including: Retrieve the access allocation time intervals from the historical access process of each user for each resource; Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access; A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource; The reference value for the overlap time length is obtained by the following formula: Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T ei T represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource; The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold; The cache duration adjustment coefficient is obtained using the following formula: Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.
7. Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space; The caching time for each resource in the cache space is obtained using the following formula: Among them, T c T represents the caching time for each resource within the cache space; b K represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
5. The web-based resource adaptive caching optimization method as described in claim 1, characterized in that: Monitor user access information to the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly, including: Monitor the data reading records of each corresponding user's access to the cache space, and generate access result information for each corresponding user to the cache space based on the data reading records; wherein, the access result information includes the integrity information of the data read by the corresponding user from the cache space; Based on the access result information, it is determined whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, the cache data is updated in the next working cycle of the cache space based on the type of the target resource accessed by the corresponding user.
6. A web-based resource adaptive caching optimization system, characterized in that, include: The effective user access determination module is used to listen to user access requests received by the web client and determine the effective user access volume received by the web client based on the user access requests. The access allocation time interval determination module is used to determine the access allocation time interval for all users to the cache space of the web terminal based on the effective user access volume. The resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web client. The cache time setting module is used to set the cache time of the resources in the resource push queue in the cache space based on the access allocation time interval; The cache space data update and adjustment module is used to monitor user access information of the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly.
7. The web-based resource adaptive caching optimization system as described in claim 6, characterized in that: The effective user access determination module is used to monitor user access requests received by the web client, and determine the number of effective user accesses received by the web client based on the user access requests, including: All network links connected to the web client are monitored to obtain all user access requests from the web client within the corresponding time interval; each user access request is parsed and processed to obtain the identity of the initiating user and the type of the target resource; based on the initiating user identity and the type of the target resource, it is determined whether the user access request is a valid user access request, and all valid user access requests are integrated into a valid user access count. The access allocation time interval determination module is used to determine the access allocation time interval for all users to the web-side cache space based on the effective user access volume, including: Based on the number of valid user accesses, determine the expected response time interval for each valid user access request; based on the expected response time interval, determine the access allocation time interval for each user to the cache space on the web client.
8. The web-based resource adaptive caching optimization system as described in claim 6, characterized in that: The resource push queue adjustment module is used to adjust the resource push queue from the database to the cache space based on the resource change characteristics of the corresponding database on the web client, including: Based on the resource change log of the database corresponding to the web client, the resource change characteristics of the database during the period when the web client receives user access requests are determined; wherein, the resource change characteristics include the type and quantity of newly added and deleted resource data in the database; based on the resource change characteristics, several latest resources corresponding to several resource data types are selected to form a resource push queue, thereby covering the original resource push queue of the cache space. The cache time setting module is used to set the cache time of resources in the resource push queue in the cache space based on the access allocation time interval, including: Based on the access allocation time interval and the respective access target resource types of all users, the caching time of all resources in the cache space is set for the resources pushed into the queue; wherein, the overlap time length between the caching time of each resource and the access allocation time interval of the corresponding user is not less than a preset time length threshold.
9. The web-based resource adaptive caching optimization system as described in claim 8, characterized in that: The cache time for all resources in the cache space pushed to the queue is set, including: Retrieve the access allocation time intervals from the historical access process of each user for each resource; Based on the access time periods in the historical access process of the user corresponding to the resource, obtain the average duration of a single access; A reference value for the overlap time length is set using the access allocation time interval in the historical access process of the user corresponding to each resource; The reference value for the overlap time length is obtained by the following formula: Where ΔT represents the reference value for the overlap time length; n represents the total number of accesses for each resource; T ei T represents the end time of the access allocation time interval corresponding to the i-th access of each resource; now Indicates the current time; T pred T represents the average duration of a single visit; si This represents the start time of the access allocation time interval corresponding to the i-th access of each resource; The cache time length adjustment coefficient is set by combining the overlap time length with a preset time length threshold; The cache duration adjustment coefficient is obtained using the following formula: Where K represents the cache duration adjustment factor; ΔT represents the overlap duration reference value; T y This represents the preset time length threshold; α represents the preset time overlap influence coefficient, with a value range of 0.2-0.
7. Retrieve the preset base cache time length, adjust the base cache time length using the cache time length adjustment coefficient, and obtain the cache time corresponding to each resource in the cache space; The caching time for each resource in the cache space is obtained using the following formula: Among them, T c T represents the caching time for each resource within the cache space; b K represents the preset base cache duration; K represents the cache duration adjustment coefficient; W represents the weight value corresponding to each resource, and W takes the value (0,1); W max represents the maximum weight corresponding to all resources; s represents the resource type influence coefficient, and 0 < s < 1.
10. The web-based resource adaptive caching optimization system as described in claim 6, characterized in that: The cache space data update and adjustment module is used to monitor user access information of the cache space, determine whether an access failure event has occurred in the cache space, and adjust the data update status of the cache space accordingly, including: Monitor the data reading records of each corresponding user's access to the cache space, and generate access result information for each corresponding user to the cache space based on the data reading records; wherein, the access result information includes the integrity information of the data read by the corresponding user from the cache space; Based on the access result information, it is determined whether the corresponding user has experienced an access failure event to the cache space; if an access failure event occurs, the cache data is updated in the next working cycle of the cache space based on the type of the target resource accessed by the corresponding user.