Computer hard disk cache data preloading method and system
By comprehensively considering user operation events, historical behavior patterns and system resource load, a preloaded data list is dynamically generated and the hard disk cache data preload task is scheduled. This solves the problem that the preloading method in the existing technology cannot respond to the user's instantaneous data access needs in a timely manner, achieves more efficient and accurate preloading, and improves the user experience.
Patent Information
- Application Number
- CN202510833618.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-20
AI Technical Summary
Existing hard disk cache preloading methods cannot respond to users' instantaneous data access needs in a timely manner when user behavior changes dynamically and system resources are instantly variable, resulting in low preloading accuracy and efficiency, serious resource waste, and poor user experience.
By comprehensively considering the user's operation event information in the application window, the window focus switching information at the system level, long-term historical behavior patterns, and the system's instantaneous resource load, it dynamically generates a preloaded data list, evaluates loading costs and predicts benefits, calculates task priorities, and schedules hard disk cache data preloading tasks.
It improves the accuracy and efficiency of preloading, reduces resource waste, and enhances user experience.
Smart Images

Figure CN120670053A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hard disk cache technology, and in particular to a method and system for preloading computer hard disk cache data. Background Art
[0002] During daily operation, computer systems frequently need to read data from the hard drive into the memory cache to speed up application startup and execution. To improve efficiency, the system uses data preloading technology to attempt to predict the data that users will access soon and load it into the cache before it is actually needed.
[0003] As technology evolves, preloading strategies have evolved to predictive models based on historical user behavior patterns. The system records the sequence, frequency, and relevance of file accesses by users in specific applications or tasks to build a user behavior model.
[0004] However, user behavior doesn't always adhere to fixed historical patterns. User actions are dynamic and emergent. For example, users may temporarily switch tasks, access data inconsistent with historical records, or engage in atypical interactions within an application. Forecasts based on historical patterns can significantly decrease in accuracy when user behavior deviates from historical patterns.
[0005] Furthermore, the preloading operation itself consumes the hard drive's read and write bandwidth and CPU resources for data transfer management. If the system is currently heavily loaded, for example, when other background tasks are actively reading and writing to the hard drive, large-scale preloading based on potentially outdated or inaccurate historical pattern predictions can further exacerbate competition for system resources. Existing preloading methods now consider the system's current resource status, such as CPU load, hard drive I / O queue depth, and memory availability, and dynamically adjust the scale and timing of preloading accordingly.
[0006] Although the overall resource status of the system is taken into consideration, such methods usually make judgments and adjustments based on the overall system load threshold. Existing methods are still not responsive and accurate enough to the instantaneous, fine-grained changes in data access requirements that occur when users quickly switch their focus within a specific application or between multiple applications.
[0007] Therefore, in an environment where user operation behavior changes dynamically and system I / O resources are instantly variable, how to combine the user's real-time fine-grained operation context information with the prediction results based on long-term historical behavior patterns, and dynamically schedule the hard disk cache data preloading task according to the instantaneous system I / O resource status, the loading cost of the data block to be loaded, and the predicted benefit, so as to cope with the user's sudden data access needs and improve the system response speed.
[0008] In view of the above problems, the existing technology needs to be improved urgently. Summary of the Invention
[0009] In view of the above-mentioned deficiencies in the prior art, the present application provides a computer hard disk cache data preloading method and system, which has the advantages of improving the accuracy and efficiency of preloading, reducing resource waste, and improving user experience.
[0010] In a first aspect, a method for preloading data from a computer hard disk cache is provided, the method comprising the steps of: S1: Obtain user operation event information within the application window and system-level window focus switching information to build real-time operation context; S2: Records the user's file access sequence, access frequency, and file relevance in the application to build a long-term historical behavior pattern; S3: generating a preloaded data list according to the real-time operation context and the long-term historical behavior pattern; S4: monitoring the system I / O resource status in real time, and evaluating the loading cost and predicted benefit of each data block in the preloaded data list; S5: Calculate the preloading task priority of each data block in the preloading data list according to the loading cost, the predicted benefit and the system I / O resource status, and schedule the hard disk cache data preloading task according to the preloading task priority.
[0011] This application proposes a method for preloading data from a computer hard drive cache. By comprehensively considering the user's current operating event information within the application window, system-level window focus switching information, long-term historical behavioral habits, and the system's instantaneous resource load, it dynamically and intelligently generates a preload data list to determine which data to preload and when to preload it. This method more effectively responds to dynamic changes in user behavior and instantaneous fluctuations in system resources, improving the accuracy and efficiency of preloading. Therefore, the method proposed in this application has the advantages of improving the accuracy and efficiency of preloading, reducing resource waste, and enhancing the user experience.
[0012] Furthermore, step S1 includes: S11: Monitor the user's mouse coordinates and keystrokes within the application window, extract click, hover, and drag events, and record event timestamps and window identifiers; S12: Parsing the window identifier, obtaining the process identifier and window class name of the application to which the window belongs, and constructing an application window operation event sequence in combination with an event timestamp; S13: Obtain the Windows system's focus window ID and its owning process ID, and record the window focus switching timestamp; S14: comparing the focus window identifier at the current moment with the focus window identifier at the previous moment according to the window focus switching timestamp, and if there is a change, extracting the process identifier and window class name of the application before and after the switching as the window focus switching information; S15: Integrate the application window operation event sequence and the window focus switching information in order according to their corresponding event timestamps and window focus switching timestamps to form a real-time operation context including user operation events and window focus switching.
[0013] This application proposes a computer hard disk cache data preloading method, which solves the problem of insufficiently detailed information by providing a specific method for obtaining fine-grained user operation event information within an application window and system-level window focus switching information, and integrating this information through timestamps to construct a more comprehensive and accurate real-time operation context.
[0014] Furthermore, step S15 includes: S151: Constructing a global timeline based on the event timestamp and the window focus switching timestamp, and inserting the application window operation event sequence and the window focus switching information into the global timeline in timestamp order to form a preliminary fused event stream; S152: For the initially merged event stream, if the time interval between adjacent events is less than a preset threshold, the events are determined to be associated events, and the associated events are merged into a composite event. S153: Parse the composite event, extract the user's operation type, operation object, and target window of window focus switching in the application window, and convert them into an event description in a unified format to form the real-time operation context including the user operation event and window focus switching.
[0015] This application proposes a computer hard disk cache data preloading method, which provides a more refined method for integrating user operation events and window focus switching information to solve the problem that simple sorting integration cannot capture event correlation, thereby constructing a real-time operation context that is more accurate and better reflects the user's instantaneous intention.
[0016] Furthermore, step S2 includes: S21: Monitoring the user's file system operations in the application. When a file access event is detected, extracting the application identifier and file path, and recording the access timestamp to form a file access record, and sorting the file access records according to the access event stamp to obtain a file access sequence; S22: regularly scanning the file access sequence and counting the access frequency of each file access path; S23: Analyze the file access records of adjacent files in the file access sequence, and if two files are accessed within a preset time window, establish file association; S24: Construct a long-term historical behavior pattern based on the file access sequence, the file access frequency, and the file relevance. The long-term historical behavior pattern is stored in a graph structure, where nodes represent files, edges represent file relevance, and node weights represent access frequencies.
[0017] This application proposes a computer hard disk cache data preloading method. Through a specific, effective and structured long-term historical behavior pattern construction method, this solution overcomes the shortcomings of constructing long-term historical behavior patterns that are not specific enough, and lays a solid data foundation for generating preloaded data lists, evaluating loading costs and predicting benefits, calculating preload task priorities and scheduling in subsequent steps, thereby improving the accuracy and efficiency of preloading.
[0018] Furthermore, step S23 includes: S231: Calculate the time interval between every two adjacent file access records in the file access sequence and construct a time interval sequence; S252: Based on the time interval sequence, an adaptive threshold segmentation algorithm is used to determine a preset time window; S253: Analyze the file access records of adjacent files in the file access sequence. If two files are accessed within the preset time window, establish file association. The file association calculation formula is: file association = α / (time interval + β), where α is an adjustable parameter and β is a smoothing factor. The value range of α is 0.5 to 1.0, and the value range of β is 0.1 to 0.5.
[0019] Furthermore, step S3 includes: S31: extracting the real-time process identifier, real-time window class name, and user operation event information of the application in the real-time operation context; extracting the file access sequence and the file association of the long-term historical behavior pattern; S32: matching the corresponding file access sequence according to the real-time process identifier and the real-time window class name, and filtering the file path associated with the operation event information from the file access sequence to form a candidate preload file list; S33: for each file path in the candidate preload file list, searching for an associated file path having a file association therewith, and adding the associated file path whose file association is greater than a preset value to the candidate preload file list; S34: De-duplication processing is performed on the file paths and the associated file paths in the candidate pre-loaded file list, and they are sorted according to file access frequencies to generate a pre-loaded data list.
[0020] Furthermore, step S4 includes: S41: monitoring the system I / O resource status in real time, obtaining CPU utilization, hard disk I / O queue length, hard disk read speed, and data block size of each data block in the preloaded data list; S42: Calculate the data block loading time based on the CPU utilization, the hard disk I / O queue length, the data block size, and the hard disk read speed, and convert the time into a loading cost; loading cost = data block size / hard disk read speed * (1 + CPU utilization) * (1 + hard disk I / O queue length / preset queue length threshold); S43: Calculate the predicted revenue of each data block based on the file access frequency and file relevance in the preloaded data list and the path relevance between the operation event information and the file path in the real-time operation context; predicted revenue = file access frequency * file relevance * path relevance.
[0021] Furthermore, step S5 includes: S51: obtaining a CPU utilization rate and a hard disk I / O queue length according to the system I / O resource status, and calculating a system I / O busyness according to the CPU utilization rate and the hard disk I / O queue length; S52: Calculate the preloading task priority according to the loading cost, the predicted benefit, and the system I / O busyness: preloading task priority = (predicted benefit / loading cost) * (1-system I / O busyness); S53: Scheduling the hard disk cache data preloading task according to the preloading task priority.
[0022] Furthermore, step S53 includes: S531: Building a priority queue according to the preload task priority; S532: Real-time monitoring of the system I / O resource status. When the system I / O busyness is lower than a preset busyness threshold, the highest priority preload task is taken from the head of the priority queue and submitted to the hard disk cache management module for execution. S543: After the preloading is completed, the corresponding task is removed from the priority queue, and S533 is repeated until the priority queue is empty or the system I / O busyness exceeds a preset busyness threshold.
[0023] In a second aspect, a computer hard disk cache data preloading system is provided, which is applied to the steps of any of the above methods, and the system comprises: The first building block: obtains user operation event information within the application window and system-level window focus switching information to build a real-time operation context; The second building block: records the user's file access sequence, access frequency, and file relevance in the application to build a long-term historical behavior pattern; A generation module: generates a preloaded data list according to the real-time operation context and the long-term historical behavior pattern; Evaluation module: monitors the system I / O resource status in real time and evaluates the loading cost and predicted benefit of each data block in the preloaded data list; Cache module: calculates the preloading task priority of each data block in the preloading data list according to the loading cost, the predicted benefit and the system I / O resource status, and schedules the hard disk cache data preloading task according to the preloading task priority.
[0024] Beneficial Effects: The present application proposes a computer hard disk cache data preloading method and system. By comprehensively considering the user's current operation event information in the application window, the system-level window focus switching information, long-term historical behavior habits, and the system's instantaneous resource load, a preloaded data list is dynamically and intelligently generated to determine which data to preload and when to preload it. This allows for more effective responses to dynamic changes in user behavior and instantaneous fluctuations in system resources, and improves the accuracy and efficiency of preloading. Therefore, the method proposed in the present application has the advantages of improving the accuracy and efficiency of preloading, reducing resource waste, and enhancing user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a flowchart of a computer hard disk cache data preloading method proposed in this application.
[0026] Figure 2 This is a structural diagram of a computer hard disk cache data preloading system proposed in this application.
[0027] Figure 3 This is an architectural diagram of a computer hard disk cache data preloading system proposed in this application.
[0028] Description of reference numerals: 201, first construction module; 202, second construction module; 203, generation module; 204, evaluation module; 205, cache module. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and marked in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work fall within the scope of protection of the present application.
[0030] It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0031] Please refer to Figure 1 In a first aspect, a method for preloading data from a computer hard disk cache is provided, the method comprising the steps of: S1: Obtain user operation event information within the application window and system-level window focus switching information to build real-time operation context; S2: Records the user's file access sequence, access frequency, and file relevance in the application to build a long-term historical behavior pattern; S3: Generates a preloaded data list based on real-time operational context and long-term historical behavior patterns; S4: Monitor the system I / O resource status in real time and evaluate the loading cost and predicted benefit of each data block in the preloaded data list; S5: Calculate the preloading task priority of each data block in the preloading data list based on the loading cost, predicted revenue, and system I / O resource status, and schedule the hard disk cache data preloading task based on the preloading task priority.
[0032] Among them, real-time operation context refers to the information set formed by capturing the user's instant interactive behavior in the application window and the window focus changes at the system level. It can be implemented using system event monitoring, API hooks and other technologies, such as monitoring mouse movement, key input, and window activation / deactivation events. Its main purpose is to perceive the user's current focus and potential operation intentions.
[0033] Long-term historical behavior patterns refer to models constructed by long-term recording and analysis of users' file access history in applications. They can be implemented using technologies such as file access logs, behavior sequence analysis, and association rule mining. For example, they can count file access frequencies, identify file access sequences, and establish associations between files. Their main purpose is to reflect users' work habits and data dependencies.
[0034] Loading cost refers to the resource consumption required to read the data block to be preloaded from the hard disk to the cache. It can be evaluated based on the data block size, hard disk read speed, current CPU utilization, hard disk I / O queue length and other system status. Its main purpose is to quantify the impact of the preloading operation on system performance.
[0035] Predicted benefit refers to the potential value that preloading a data block may bring. It can be evaluated based on the importance of the data block in historical behavior patterns, its relevance to the current real-time operation context, and the possibility of being accessed by users. Its main purpose is to quantify the potential of preloading operations to improve user experience.
[0036] The preloading task priority refers to a ranking index calculated for each data block to be preloaded after comprehensively considering the loading cost, predicted benefit, and the current I / O resource status of the system. It can be implemented using weighted calculation or model-based evaluation methods. Its main purpose is to determine the execution order and urgency of the preloading tasks.
[0037] As a preferred embodiment, the solution of this application is specifically implemented as follows: Through the system API or hook program, it captures user events such as mouse clicks and keyboard inputs in the active window, and records the time the event occurs and the window ID to which it belongs. At the same time, it monitors changes in the system's focus window and records the switching time. These events are then integrated into a real-time operation context in chronological order.
[0038] Continuously monitor file system access operations in the background, recording the file paths and times accessed by applications, and counting the number of times each file is accessed. Analyze access sequences, identify files that are accessed consecutively within a short period of time, establish file associations, and store this information as long-term historical behavior patterns, for example, using a database or graph structure.
[0039] When the real-time operation context changes, a list of potential access files is generated by combining the current context information (such as the current application and recent operations) and long-term historical patterns (such as the file sequence and high-frequency files associated with the current application or operation).
[0040] Real-time acquisition of performance metrics such as system CPU utilization and disk I / O queue length. For each file in the preload list, the loading time is calculated as the loading cost based on its size, current disk read speed, and system load. The predicted benefit is calculated based on its access frequency, relevance, and match with the current context in historical patterns.
[0041] A formula is used to calculate the preloading priority of each file based on the loading cost, predicted revenue, and system load. The files to be preloaded and their priorities are placed in a priority queue. A scheduling module continuously monitors the system I / O load. When the load falls below a certain threshold, the highest-priority task is removed from the priority queue and submitted to the disk cache management module for preloading.
[0042] Through the above scheme, this application can more accurately predict the data that users are about to access, especially when user behavior deviates from historical habits. By incorporating real-time operational context, the responsiveness and accuracy of the predictions are improved. Furthermore, by evaluating loading costs and predicted benefits in real time, and dynamically scheduling preloading tasks based on the instantaneous system I / O resource status, this effectively avoids unnecessary or costly preloading during high loads, reduces resource competition, and improves overall system performance and user experience.
[0043] Furthermore, step S1 includes: S11: Monitor the user's mouse coordinates and keystrokes within the application window, extract click, hover, and drag events, and record event timestamps and window identifiers; S12: Parse the window ID to obtain the process ID and window class name of the application to which the window belongs, and construct an application window operation event sequence based on the event timestamp; S13: Obtain the Windows system's focus window ID and its owning process ID, and record the window focus switching timestamp; S14: comparing the current focus window identifier with the previous focus window identifier based on the window focus switching timestamp; if there is a change, extracting the process identifier and window class name of the application before and after the switch as the window focus switching information; S15: Integrate the application window operation event sequence and the window focus switching information in order according to their corresponding event timestamps and window focus switching timestamps to form a real-time operation context including user operation events and window focus switching.
[0044] The mouse coordinates and keys within the application window refer to the location of the mouse moved and the actions of pressing or releasing keyboard keys by the user within a specific application interface.
[0045] Among them, click, hover, and drag events refer to the types of user interaction actions determined based on mouse coordinates and key combinations, and can be identified using event parsing logic.
[0046] Among them, the event timestamp refers to the precise time record of the event, which can be obtained using the timing function provided by the system.
[0047] The window identifier refers to a unique identifier assigned to each window by the operating system, which can be obtained using a system API function.
[0048] The process ID refers to a unique identifier assigned by the operating system to each running program, which can be obtained according to the window ID using the system API function.
[0049] The window class name refers to a character string used by the operating system to identify the window type, which can be obtained using a system API function based on the window identifier.
[0050] An application window operation event sequence refers to a collection of user operation event records within a specific application window arranged in chronological order.
[0051] The focus window identifier of the Windows system refers to the unique identifier of the window with which the current user is interacting, which can be obtained using the system API function.
[0052] The window focus switch timestamp is the precise time record of the window focus change.
[0053] Window focus switching information refers to recording the relevant information when the window focus switches from one window to another, including the application process identifier and window class name before and after the switch.
[0054] In one example, in order to obtain user operation event information in an application window and system-level window focus switching information and build a real-time operation context, the following method can be used.
[0055] First, by setting up system hooks to monitor the user's mouse coordinates and keys in the application window, capture messages such as mouse movement, key pressing and releasing, and determine specific operation events such as click, hover, drag, etc. based on these message sequences, and record the time when the event occurred and the corresponding window ID.
[0056] Next, based on the obtained window ID, the system API is called to parse the process ID and window class name of the application to which the window belongs. This information is then combined with the operation events to construct a chronological sequence of application window operation events. Simultaneously, the system API is periodically queried to obtain the ID of the currently focused window and the ID of its owning process, and the time of the focus switch is recorded.
[0057] By comparing the current and previous focus window identifiers, when a window focus switch is detected, the process identifier and window class name of the application before and after the switch are extracted as the window focus switch information. Finally, the application window operation event sequence is merged with the window focus switch information and globally sorted according to their respective timestamps to form a real-time operation context that includes user operation events and window focus switches.
[0058] Furthermore, step S15 includes: S151: Construct a global timeline based on the event timestamps and the window focus switching timestamps, and insert the application window operation event sequence and the window focus switching information into the global timeline in the order of the timestamps to form a preliminary fused event stream; S152: For the initially merged event stream, if the time interval between adjacent events is less than a preset threshold, the events are determined to be associated events, and the associated events are merged into a composite event; S153: Parse the composite event, extract the user's operation type, operation object, and target window of the window focus switch in the application window, and convert them into an event description in a unified format to form a real-time operation context including the user operation event and the window focus switch.
[0059] Specifically, in step S151, the global timeline provides a unified time reference system, so that events from different sources can be compared and sorted on the same time dimension. The initial fused event stream is the result of all original events being arranged in chronological order.
[0060] Furthermore, in step S152, the preset threshold is a time parameter used to define the temporal closeness between events. A linked event is a series of events that occur within a short period of time and are closely connected in time. A composite event is a structure that represents one or more linked events as a whole.
[0061] In step S513, parsing the composite event is the process of extracting key information from the composite event. The unified format of the event description is to organize the extracted information according to a predetermined structure to facilitate processing and understanding by subsequent modules.
[0062] As a specific implementation, assume that a user quickly double-clicks a folder icon in a file manager window (event A), and then immediately switches to a text editor window (event B).
[0063] When building the real-time operational context, first record the timestamp of event A and the timestamp of event B . Build a global timeline and insert event A and event B in chronological order to form a preliminary fused event stream, for example: [Event , event ]. Next, calculate the time interval between event A and event B If the time interval is less than a preset threshold (e.g., 300 milliseconds), then event A and event B are determined to be associated events. Event A and event B are merged into a composite event.
[0064] Next, parse this compound event. Extract the action type (double-click) and action target (a folder icon corresponding to a file path) from event A. Extract the target window (the text editor window) of the window focus switch from event B. Combine this information into a unified event description, for example, "Double-clicking the folder [file path] in the file manager immediately switches to the text editor."
[0065] This unified format of the event description constitutes part of the real-time operation context and can more accurately reflect the user's intention to open the file in the folder and edit it in a text editor.
[0066] Furthermore, step S2 includes: S21: Monitor the user's file system operations in the application. When a file access event is detected, extract the application identifier and file path, and record the access timestamp to form a file access record. The file access records are then sorted according to the access timestamp to obtain a file access sequence. S22: Periodically scan the file access sequence and count the access frequency of each file access path; S23: Analyze the file access records of adjacent files in the file access sequence, and if two files are accessed within a preset time window, establish file association; S24: Based on the file access sequence, file access frequency, and file relevance, a long-term historical behavior pattern is constructed. The long-term historical behavior pattern is stored in a graph structure, where nodes represent files, edges represent file relevance, and node weights represent access frequencies.
[0067] In a specific embodiment, when a user uses a document editing application, the system may detect that the user has opened "report draft.docx", "data spreadsheet.xlsx" and "reference picture.png" in sequence.
[0068] Step S21 records the three file access events, including the application identifier (document editing program), the file path, and the respective access timestamps, and sorts these records by time to form a file access sequence.
[0069] Step S22 regularly counts the access frequencies of these files. For example, "report draft.docx" might be frequently accessed, while "reference image.png" is less frequently accessed. Step S23 analyzes adjacent access records in the file access sequence. If "report draft.docx" and "data spreadsheet.xlsx" are accessed consecutively within a short time interval, a file association is established between them. Similarly, if "data spreadsheet.xlsx" and "reference image.png" are accessed within a preset time window, a file association is established between them.
[0070] Step S24 integrates this information to construct a graph structure, where "report draft.docx," "data spreadsheet.xlsx," and "reference image.png" are nodes, with edges based on temporal proximity between them. Node weights reflect their access frequency. For example, the "report draft.docx" node has a high weight, and an edge exists between it and the "data spreadsheet.xlsx" node, indicating that the user frequently accesses the data spreadsheet after accessing the report draft. This graph structure constitutes a specific example of the user's long-term historical behavior pattern within the document editing application.
[0071] Furthermore, step S23 includes: S231: Calculate the time interval between every two adjacent file access records in the file access sequence and construct a time interval sequence; S252: Determine a preset time window using an adaptive threshold segmentation algorithm based on the time interval sequence; S253: Analyze the file access records of adjacent files in the file access sequence. If two files are accessed within a preset time window, establish file association. The file association calculation formula is: file association = α / (time interval + β), where α is an adjustable parameter and β is a smoothing factor. The value range of α is 0.5 to 1.0, and the value range of β is 0.1 to 0.5.
[0072] By refining the specific process of establishing file associations, this solution solves the problems of how to more accurately and flexibly determine the time window for judging file associations and how to quantify the strength of file associations, thereby improving the quality of constructing long-term historical behavior patterns.
[0073] Specifically, by calculating the time interval between every two adjacent file access records in a file access sequence and constructing a time interval sequence, this provides basic data for subsequent analysis of the temporal patterns of file access. The adaptive threshold segmentation algorithm dynamically adjusts the threshold based on the statistical distribution of file access time intervals. This algorithm includes calculating the mean and standard deviation of the time interval sequence. The initial value of the preset time window is calculated according to the formula: threshold = mean of the time interval sequence + k * standard deviation of the time interval sequence, where k is an adjustable parameter. The preset time window is the threshold. A larger k value increases the threshold and the preset time window; a smaller k value decreases the threshold and the preset time window.
[0074] Based on the time interval sequence, an adaptive threshold segmentation algorithm is used to determine the preset time window. This makes the determination of the time window no longer a fixed empirical value, but can be dynamically adjusted according to the actual file access pattern, thereby more accurately reflecting the user's file access habits in different scenarios, and improving the adaptability and accuracy of judging file relevance in different applications and tasks.
[0075] Furthermore, the file relevance calculation formula incorporates the time interval between file accesses into the relevance calculation. The smaller the time interval, the larger the calculated relevance value, reflecting the principle that closer accesses are in time, the stronger the relevance. By introducing adjustable parameters α and β, the relevance calculation can be fine-tuned based on actual data or optimization objectives, making the quantified relevance more responsive to actual needs. This quantified relevance information is more refined than simple binary relevance (yes or no), more accurately describing the degree of relevance between files. This provides a richer and more reliable basis for subsequent preloading prediction and prioritization based on file relevance. In this way, the long-term historical behavior patterns constructed, in which the edges (relevance) between nodes (files) not only reflect the connectivity but also the closeness of the relationship through the edge weights (quantified relevance), while the node weights (access frequency) reflect the overall importance of the files. This more refined and accurate behavior pattern better supports subsequent preloading decisions. Combined with real-time operational context, it can more effectively predict the data that users will access, thereby improving the accuracy and efficiency of preloading.
[0076] Furthermore, step S3 includes: S31: Extract the real-time process ID, real-time window class name, and user operation event information of the application in the real-time operation context; extract the file access sequence and file association of the long-term historical behavior pattern; S32: Matching a corresponding file access sequence according to the real-time process identifier and the real-time window class name, and filtering the file path associated with the operation event information from the file access sequence to form a candidate preload file list; S33: for each file path in the candidate preload file list, searching for associated file paths having a file association therewith, and adding associated file paths whose file association is greater than a preset value to the candidate preload file list; S34: De-duplicate the file paths and associated file paths in the candidate pre-loaded file list, sort them according to file access frequencies, and generate a pre-loaded data list.
[0077] This solution combines instantaneous information of real-time operational context with stable laws of long-term historical behavior patterns through a series of steps to generate a more accurate preloaded data list.
[0078] Specifically, the extracted real-time process identifiers, real-time window class names, and user operation event information accurately pinpoint the user's current activity focus and potential intentions. Furthermore, the acquired file access sequences and file associations provide historical data on the user's past behavior habits and the inherent connections between files.
[0079] Using real-time process IDs and window class names, the system quickly locates historical activity segments related to the current application from within a vast historical file access sequence. Based on this, it further analyzes the user's real-time operation events and filters the file paths most likely related to the current operation from the matched historical segments, forming a preliminary candidate list. This process effectively combines the user's current specific operation with relevant historical experience, improving the specificity of the initial prediction.
[0080] Then, for each file in the preliminary candidate list, we leverage the file associations recorded in long-term historical behavior patterns to find other files with strong correlations and add these related files to the candidate list. This step, based on the file access chains discovered in history, predicts which files a user is likely to access next after accessing a certain file, thereby expanding the scope of preloading and addressing the potential for sudden changes in user behavior.
[0081] Finally, the candidate list, which integrates directly related and associated files, is deduplicated to eliminate duplicates and ensure the validity of the list. The list is then sorted based on the frequency of file accesses calculated from long-term historical behavior patterns, giving files with higher historical access frequencies higher priority.
[0082] Through this series of steps, this solution generates a preloaded data list that reflects the user's current, fine-grained operational intent while also taking into account their long-term behavioral habits and inter-file relationships. This list is more accurate and comprehensive than lists generated based solely on simple rules or historical statistics. It can better predict the data a user will access soon, providing high-quality input for subsequent loading costs, predicted benefit assessments, and task priority calculations, thereby improving the accuracy and efficiency of overall preloading.
[0083] Furthermore, step S4 includes: S41: monitor the system I / O resource status in real time, obtain CPU utilization, hard disk I / O queue length, hard disk read speed, and data block size of each data block in the preloaded data list; S42: Calculate the data block loading time based on the CPU utilization, the hard disk I / O queue length, the data block size, and the hard disk read speed, and convert it into a loading cost; loading cost = data block size / hard disk read speed * (1 + CPU utilization) * (1 + hard disk I / O queue length / preset queue length threshold); S43: Calculate the predicted revenue of each data block based on the file access frequency and file relevance in the preloaded data list and the path relevance between the operation event information and the file path in the real-time operation context; predicted revenue = file access frequency * file relevance * path relevance.
[0084] The system I / O resource status refers to the current workload and availability of input / output devices (such as hard disks) and related processing units (such as CPUs) in the computer system, which can be obtained by monitoring the performance counters or API interfaces provided by the operating system.
[0085] Loading cost refers to the resource consumption required to read a data block from the hard disk into the memory.
[0086] Predicted benefit refers to the possibility that a data block will be actually accessed by the user after preloading the data block and the performance improvement value it brings.
[0087] File access frequency refers to the number of times a specific file or data block has been accessed within a period of time.
[0088] File association refers to the degree to which two or more files are frequently accessed together in a sequence of user operations.
[0089] Path relevance refers to the degree of correlation between the user's current real-time operation event (such as hovering the mouse over a UI element) and a specific file path.
[0090] In one embodiment, real-time monitoring of the system I / O resource status can utilize the performance monitoring interface provided by the operating system. For example, in a Windows system, the Performance Data Helper (PDH) API can be called to obtain CPU utilization, hard disk I / O queue length (such as Avg. Disk Queue Length) and hard disk read speed (such as Disk ReadBytes / sec).
[0091] The data block size in the preloaded data list can be obtained by querying the file system to obtain the size information of the corresponding file or file segment.
[0092] To calculate the loading cost, substitute the obtained CPU utilization (for example, 0.5 represents 50%), disk I / O queue length (for example, 5), disk read speed (for example, 100 MB / s), and data block size (for example, 1 MB) into the formula.
[0093] The preset queue length threshold can be set according to the system type and experience, for example, 10. When calculating the predicted revenue, the file access frequency can be queried from long-term historical behavior patterns, for example, a file was accessed 10 times in the past day.
[0094] File relevance can be calculated based on historical access sequences. For example, the probability of accessing file B immediately after accessing file A is 0.8. Path relevance can be determined based on real-time operational context. For example, if a user hovers over a UI element that is strongly associated with a file path, the path relevance can be assessed as 0.9. These values are substituted into the predicted revenue formula for calculation.
[0095] This cost-benefit assessment, combined with real-time system status, helps avoid unnecessary preloading during busy periods, minimizing the impact on normal system operations. It also prioritizes preloading data blocks that are most likely to be accessed by users and have relatively low loading costs. This improves the intelligence of preloading decisions, making more efficient use of preloading resources, better addressing sudden user data access demands, and improving system responsiveness.
[0096] Furthermore, step S5 includes: S51: Obtaining CPU utilization and hard disk I / O queue length according to the system I / O resource status, and calculating the system I / O busyness based on the CPU utilization and hard disk I / O queue length; S52: Calculate the preloading task priority based on the loading cost, the predicted benefit, and the system I / O busyness: preloading task priority = (predicted benefit / loading cost) * (1-system I / O busyness); S53: Scheduling the hard disk cache data preloading task according to the preloading task priority.
[0097] This solution proposes a specific implementation method for the steps of calculating the priority of preloading tasks and scheduling tasks based on loading costs, predicted benefits and system I / O resource status.
[0098] First, we obtain the system I / O resource status, specifically CPU utilization and disk I / O queue length. These two metrics directly reflect the current system I / O load. Based on these two metrics, we calculate a quantitative system I / O busyness. A higher busyness value indicates a more constrained system I / O resource. Specifically, we use a simple weighted average formula: busyness = w1 * normalized CPU utilization + w2 * normalized disk I / O queue length, where w1 and w2 are weight coefficients, and their sum is 1.
[0099] Subsequently, when calculating the preload task priority, not only is the value of the task itself (the ratio of predicted benefit to load cost) considered, but the calculated system I / O busyness is also creatively incorporated. By multiplying the predicted benefit to load cost ratio by (1-system I / O busyness), task priority is dynamically influenced by the current system load. When system I / O busyness is high, the value of (1-system I / O busyness) is small, lowering the calculated task priority, even if the task's inherent benefit is high. Conversely, when system I / O busyness is low, this term is close to 1, and task priority is primarily determined by its benefit-to-cost ratio. This calculation method ensures that preloading is not performed blindly when system resources are limited, thereby avoiding increasing system burden, while enabling more proactive preloading when system resources are idle.
[0100] Finally, the hard disk cache data preloading tasks are scheduled based on the calculated preloading task priority. This means that the system will first execute those tasks with the highest priority under the current system load.
[0101] In this way, the present solution can ensure that the execution order and timing of preloading tasks can dynamically adapt to changes in the instantaneous system I / O resource state, thereby making more efficient use of system resources.
[0102] Furthermore, step S53 includes: S531: Building a priority queue according to the preload task priority; S532: Real-time monitoring of the system I / O resource status. When the system I / O busyness is lower than a preset busyness threshold, the highest priority preload task is taken from the head of the priority queue and submitted to the hard disk cache management module for execution. S543: After the preloading is completed, the corresponding task is removed from the priority queue, and S533 is repeated until the priority queue is empty or the system I / O busyness exceeds a preset busyness threshold.
[0103] In a specific embodiment, the priority queue data structure provided by the standard library can be used to store preloading tasks, and the task object contains the identifier of the data block to be loaded and the calculated priority value. Real-time monitoring of the system I / O resource status can be achieved by calling the performance monitoring API provided by the operating system. For example, in a Windows system, the Performance Counter API can be used to obtain indicators such as '% Disk Time' or 'Current Disk Queue Length', and the system I / O busyness can be calculated in combination with the CPU utilization. The preset busyness threshold can be set to an empirical value, such as 0.6 or 0.7, which means that when the hard disk busy time exceeds 60% or 70% of the total time, the system I / O is considered busy.
[0104] The scheduling logic can be implemented in a separate thread that periodically (for example, every tens or hundreds of milliseconds) checks the system I / O busyness. When the busyness is below the threshold, the thread retrieves the task from the top of the priority queue and submits a preload request by calling a system function related to disk cache management (such as a specific file system cache control interface or driver interface). After submission, the thread can wait for notification of request completion (for example, through an event notification or callback function), or submit and periodically check the task status in non-blocking mode. After the task is completed, it is removed from the priority queue. If the system I / O busyness exceeds the threshold, the scheduling thread can enter a dormant state for a period of time or reduce the check frequency to reduce the use of system resources until the busyness decreases, and then resume normal scheduling checks and submissions.
[0105] Please refer to Figure 2 、 Figure 3 A computer hard disk cache data preloading system, applied to the steps of any of the above methods, comprises: The first building module 201: obtains user operation event information in the application window and window focus switching information at the system level, and builds a real-time operation context; Second building block 202: records the user's file access sequence, access frequency, and file relevance in the application, and builds a long-term historical behavior pattern; Generating module 203: generating a preloaded data list based on the real-time operation context and the long-term historical behavior pattern; Evaluation module 204: monitors the system I / O resource status in real time and evaluates the loading cost and predicted benefit of each data block in the pre-loaded data list; Cache module 205: calculates the preloading task priority of each data block in the preloading data list according to the loading cost, predicted revenue and system I / O resource status, and schedules the hard disk cache data preloading task according to the preloading task priority.
[0106] The first building block 201 refers to a functional unit responsible for sensing the user's current interactive behavior at the system and application levels, which can be implemented using system hooks, message monitoring mechanisms, event buses, or specific API calls.
[0107] The second building block 202 refers to a functional unit responsible for collecting, storing and analyzing the long-term file access history of users in applications, which can be implemented using file system filter drivers, logging services, database storage or graph structure data management.
[0108] The generation module 203 refers to a functional unit that predicts a user's potential data access needs based on the user's real-time behavior and long-term historical habits and outputs a candidate data list. It can be implemented using a rule engine, a machine learning model, an association analysis algorithm, or a prediction method based on graph traversal.
[0109] The evaluation module 204 is a functional unit that obtains system resource usage in real time and quantifies the potential value and resource consumption of preload tasks. It can be implemented using system performance counters, resource monitoring APIs, mathematical models, or statistical analysis methods.
[0110] The cache module 205 refers to a functional unit that determines whether and how to execute the preloading operation based on the priority of the preloading task and the availability of system resources. It can be implemented using a priority queue, a task scheduler, a cache management interface or an asynchronous I / O mechanism.
[0111] By breaking down complex data preloading methods into multiple functional modules, the system achieves comprehensive perception, analysis, and intelligent scheduling of user behavior, historical patterns, and system resource status. Specifically, the first construction module 201 is responsible for acquiring user action event information within application windows and system-level window focus switching information. By building real-time action context, the system can capture instantaneous, fine-grained changes in user behavior, providing immediate basis for subsequent predictions.
[0112] The second building block 202 is responsible for recording the user's file access sequence, access frequency, and file relevance within the application. Learning and analyzing this long-term historical data provides a stable foundation for predicting the user's future file access. Combining this with real-time context improves the accuracy and robustness of the predictions.
[0113] The generation module 203 generates a list of preloaded data based on the real-time operational context constructed by the first construction module and the long-term historical behavior patterns constructed by the second construction module. This means that the candidate data for preloading is derived based on a comprehensive assessment of the user's current real-time behavior and their historical habits, improving the relevance of the prediction and avoiding the bias caused by relying solely on historical patterns.
[0114] Evaluation module 204 monitors the system's I / O resource status in real time, capturing key metrics such as CPU utilization and disk I / O queue length. It also evaluates the loading cost and predicted benefit of each data block in the preloaded data list. The loading cost takes into account the data block size and the current system I / O busyness, while the predicted benefit integrates the file's historical access frequency, relevance, and relevance to current real-time operations. Through this meticulous cost-benefit assessment, the system can quantify the potential value of each preload task and its consumption of system resources, providing a basis for subsequent intelligent scheduling.
[0115] The cache module 205 calculates the preloading task priority for each data block in the preloading data list based on the loading cost and predicted benefit calculated by the evaluation module, as well as the real-time system I / O resource status. The priority comprehensively considers the potential benefit of preloading, the execution cost, and the current availability of system I / O resources. The hard disk cache data preloading task is then scheduled based on the calculated priority.
[0116] This collaborative work and data flow between modules enables the system to efficiently execute the entire preloading process and respond promptly to changes in user behavior and system status, thereby overcoming the problems of inefficiency and slow response that may result from tightly coupling all functions together, and enabling complex method steps to be effectively implemented and play their due role.
[0117] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.
[0118] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Persons skilled in the art will readily appreciate that the present application may be modified and altered in various ways. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A computer hard disk cache data preloading method, characterized in that: The method comprises the steps of: S1: Obtain user operation event information within the application window and system-level window focus switching information to build real-time operation context; S2: Records the user's file access sequence, access frequency, and file relevance in the application to build a long-term historical behavior pattern; S3: generating a preloaded data list according to the real-time operation context and the long-term historical behavior pattern; S4: monitoring the system I / O resource status in real time, and evaluating the loading cost and predicted benefit of each data block in the preloaded data list; S5: Calculate the preloading task priority of each data block in the preloading data list according to the loading cost, the predicted benefit and the system I / O resource status, and schedule the hard disk cache data preloading task according to the preloading task priority.
2. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S1 includes: S11: Monitor the user's mouse coordinates and keystrokes within the application window, extract click, hover, and drag events, and record event timestamps and window identifiers; S12: Parsing the window identifier, obtaining the process identifier and window class name of the application to which the window belongs, and constructing an application window operation event sequence in combination with an event timestamp; S13: Obtain the Windows system's focus window ID and its owning process ID, and record the window focus switching timestamp; S14: comparing the focus window identifier at the current moment with the focus window identifier at the previous moment according to the window focus switching timestamp, and if there is a change, extracting the process identifier and window class name of the application before and after the switching as the window focus switching information; S15: Integrate the application window operation event sequence and the window focus switching information in order according to their corresponding event timestamps and window focus switching timestamps to form a real-time operation context including user operation events and window focus switching.
3. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S15 includes: S151: Constructing a global timeline based on the event timestamp and the window focus switching timestamp, and inserting the application window operation event sequence and the window focus switching information into the global timeline in timestamp order to form a preliminary fused event stream; S152: For the initially merged event stream, if the time interval between adjacent events is less than a preset threshold, the events are determined to be associated events, and the associated events are merged into a composite event. S153: Parse the composite event, extract the user's operation type, operation object, and target window of window focus switching in the application window, and convert them into an event description in a unified format to form the real-time operation context including the user operation event and window focus switching.
4. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S2 includes: S21: Monitoring the user's file system operations in the application. When a file access event is detected, extracting the application identifier and file path, and recording the access timestamp to form a file access record, and sorting the file access records according to the access event stamp to obtain a file access sequence; S22: regularly scanning the file access sequence and counting the access frequency of each file access path; S23: Analyze the file access records of adjacent files in the file access sequence, and if two files are accessed within a preset time window, establish file association; S24: Construct a long-term historical behavior pattern based on the file access sequence, the file access frequency, and the file relevance. The long-term historical behavior pattern is stored in a graph structure, where nodes represent files, edges represent file relevance, and node weights represent access frequencies.
5. A computer hard disk cache data preloading method according to claim 4, characterized in that: Step S23 includes: S231: Calculate the time interval between every two adjacent file access records in the file access sequence and construct a time interval sequence; S252: Based on the time interval sequence, an adaptive threshold segmentation algorithm is used to determine a preset time window; S253: Analyze the file access records of adjacent files in the file access sequence. If two files are accessed within the preset time window, establish file association. The file association calculation formula is: file association = α / (time interval + β), where α is an adjustable parameter and β is a smoothing factor. The value range of α is 0.5 to 1.0, and the value range of β is 0.1 to 0.
5.
6. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S3 includes: S31: extracting the real-time process identifier, real-time window class name, and user operation event information of the application in the real-time operation context; extracting the file access sequence and the file association of the long-term historical behavior pattern; S32: matching the corresponding file access sequence according to the real-time process identifier and the real-time window class name, and filtering the file path associated with the operation event information from the file access sequence to form a candidate preload file list; S33: for each file path in the candidate preload file list, searching for an associated file path having a file association therewith, and adding the associated file path whose file association is greater than a preset value to the candidate preload file list; S34: De-duplication processing is performed on the file paths and the associated file paths in the candidate pre-loaded file list, and they are sorted according to file access frequencies to generate a pre-loaded data list.
7. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S4 includes: S41: monitoring the system I / O resource status in real time, obtaining CPU utilization, hard disk I / O queue length, hard disk read speed, and data block size of each data block in the preloaded data list; S42: Calculate the data block loading time based on the CPU utilization, the hard disk I / O queue length, the data block size, and the hard disk read speed, and convert the time into a loading cost; loading cost = data block size / hard disk read speed * (1 + CPU utilization) * (1 + hard disk I / O queue length / preset queue length threshold); S43: Calculate the predicted revenue of each data block based on the file access frequency and file relevance in the preloaded data list and the path relevance between the operation event information and the file path in the real-time operation context; predicted revenue = file access frequency * file relevance * path relevance.
8. A computer hard disk cache data preloading method according to claim 1, characterized in that: Step S5 includes: S51: obtaining a CPU utilization rate and a hard disk I / O queue length according to the system I / O resource status, and calculating a system I / O busyness according to the CPU utilization rate and the hard disk I / O queue length; S52: Calculate the preloading task priority according to the loading cost, the predicted benefit, and the system I / O busyness: preloading task priority = (predicted benefit / loading cost) * (1-system I / O busyness); S53: Scheduling the hard disk cache data preloading task according to the preloading task priority.
9. A computer hard disk cache data preloading method according to claim 8, characterized in that: Step S53 includes: S531: Building a priority queue according to the preload task priority; S532: Real-time monitoring of the system I / O resource status. When the system I / O busyness is lower than a preset busyness threshold, the highest priority preload task is taken from the head of the priority queue and submitted to the hard disk cache management module for execution. S543: After the preloading is completed, the corresponding task is removed from the priority queue, and S533 is repeated until the priority queue is empty or the system I / O busyness exceeds a preset busyness threshold.
10. A computer hard disk cache data preloading system, characterized in that: In the steps of the method according to any one of claims 1 to 9, the system comprises: The first building block: obtains user operation event information within the application window and system-level window focus switching information to build a real-time operation context; The second building block: records the user's file access sequence, access frequency, and file relevance in the application to build a long-term historical behavior pattern; A generation module: generates a preloaded data list according to the real-time operation context and the long-term historical behavior pattern; Evaluation module: monitors the system I / O resource status in real time and evaluates the loading cost and predicted benefit of each data block in the preloaded data list; Cache module: calculates the preloading task priority of each data block in the preloading data list according to the loading cost, the predicted benefit and the system I / O resource status, and schedules the hard disk cache data preloading task according to the preloading task priority.
Citation Information
Patent Citations
Distributed caching method and device, electronic equipment and nonvolatile storage medium
CN118981281A
Intelligent caching method and device for loading front-end resources as required, equipment and medium
CN119691305A
System and method for preloading content on the basis of user context
US20080201332A1
Cited By
Response speed increasing method and system for intelligent earphone integrating multifunctional scheduling file
CN120973438A
Credit investigation service processing method and device
CN121352959A