A file access hotness calculation method, system and medium based on a large model
By using a file access hot/cold ranking method based on a large language model, the problem that cache eviction algorithms cannot distinguish the intrinsic attributes of files is solved, enabling precise cache management and personalized services, improving cache hit rate and user experience, while ensuring privacy and security.
Patent Information
- Application Number
- CN202511171571.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-21
AI Technical Summary
In existing technologies, cache eviction algorithms such as LRU and LFU cannot effectively distinguish the intrinsic attributes of files, which may lead to important files being wrongly evicted, affecting cache effectiveness and user experience.
We adopt a file access popularity calculation method based on a large language model. Through multi-dimensional feature extraction, semantic reasoning and adaptive learning, we generate file popularity scores and optimize cache management decisions.
It achieves accurate prediction of the probability of future file access, improves cache hit rate, ensures smooth access to critical data, and has personalized adaptability and privacy security.
Smart Images

Figure CN120670335B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage technology, and in particular to a method, system, and medium for calculating the hotness and coldness of file access based on a large model. Background Technology
[0002] With the widespread adoption of cloud computing, it has become commonplace for users to interact with cloud storage via PC clients (such as those supporting the POSIX protocol). To accelerate file access and save network bandwidth, these clients typically employ local hard drive caching technology. However, local cache space is limited, and when the cache is full, a cache eviction mechanism must be activated to delete some files to make room for new data.
[0003] Existing technologies such as Least Recently Used (LRU) and Least Frequently Used (LFU) algorithms rely solely on file access timestamps and frequency for decision-making. These algorithms treat all files equally, failing to discern intrinsic file attributes. For instance, an important file named "Project Architecture Design - Final Draft.pptx" might be evicted by the LRU algorithm if it hasn't been accessed for several days, while a frequently written but less valuable log file like "debug.log" is retained. This "mechanical" decision-making severely impacts caching effectiveness and could even cause user work interruptions at critical moments due to cache misses.
[0004] While some studies have attempted to improve evaluation by introducing more features and machine learning models (such as decision trees and simple neural networks), these models typically require large amounts of labeled data for supervised training and have limited ability to understand the rich semantic information contained in unstructured text data such as filenames and paths. They struggle to truly understand the differences in importance conveyed by words like "draft," "final," and "backup," and cannot infer that files in the " / src / core / " directory should be preserved more than those in the " / temp / logs / " directory. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, system and medium for calculating the hotness and coldness of file access based on a large model.
[0006] The objective of this invention is achieved through the following technical solution: The first aspect of this invention provides a method for calculating the hotness / coldness of file access based on a large model, comprising the following steps:
[0007] During the system initialization and monitoring configuration phase, the hot / cold index calculation algorithm is initialized, the pre-deployed large language model is loaded, and then various running parameters are read from the configuration file, and file operation events in the local cache directory are monitored.
[0008] In the multi-dimensional feature extraction stage, multi-dimensional feature vectors of the target file are extracted in real time.
[0009] In the dynamic prompt generation stage, multi-dimensional feature vectors are dynamically arranged into structured natural language prompts and input into the large language model;
[0010] In the popularity generation and cache management stage, a large language model is used to perform semantic reasoning on structured natural language prompts to generate a popularity score for each file, and cache space is managed based on the popularity score.
[0011] In the adaptive learning and optimization phase, an implicit user feedback loop is established. When a preset value of feedback signal is accumulated, the large language model is incrementally fine-tuned based on the collected feedback data.
[0012] Preferably, the large language model is a lightweight model that has been distilled and compressed; the operating parameters include a warning threshold for cache space occupancy, a time interval for periodic evaluation, the path to the LLM model file, and a backup eviction algorithm; the file operation events include file opening, reading, writing, closing, renaming, and deleting.
[0013] Preferably, the multi-dimensional feature vector includes at least recency features, frequency features, semantic features, and contextual features; the multi-dimensional feature extraction stage further includes the following steps:
[0014] When a file access event is detected, the last access time and last modification timestamp of the accessed file are updated in real time to obtain the proximate characteristics.
[0015] A counter structure is maintained in memory for each cache file to record the number of accesses within different time windows to obtain frequency characteristics;
[0016] The filenames of the target files are segmented and matched with a predefined keyword library; then the complete directory path of the target files is analyzed, the path depth is calculated, and the keywords in the path are identified to obtain semantic features.
[0017] Based on the target file's extension, the basic importance score of the file type is retrieved from the configurable mapping table; then, the parent directories of the target file are traversed upwards to check if a project identifier file exists. If it does, the target file is marked as a project file, and finally, the context features are obtained.
[0018] Preferably, the dynamic prompt generation stage further includes the following steps:
[0019] When the cache space utilization exceeds the preset warning threshold or when the periodic evaluation timer is triggered, the hot / cold evaluation process for some or all cached files is initiated.
[0020] When the number of cached files exceeds the preset number of files, a candidate file set is initially selected according to preset conditions, and only the hotness and coldness of the candidate file set are evaluated.
[0021] Iterate through each candidate file and fill the multi-dimensional feature vector of each candidate file into the preset natural language prompt template to generate structured natural language prompts;
[0022] Then, the structured natural language prompts of multiple candidate documents are batch-processed and combined into a batch, which is then submitted to the large language model all at once.
[0023] Preferably, the heat generation and cache management stage further includes the following steps:
[0024] The large language model performs independent semantic understanding and logical reasoning on the prompts after each batch processing.
[0025] The large language model outputs structured data, including a unique identifier for each candidate document, a calculated popularity score, and text of optional reasoning arguments;
[0026] The popularity score of each candidate file is updated in the global file metadata mapping table maintained by the system. If the large language model fails to return a valid popularity score for a file, the backup strategy is activated to assign a score to the file and update it in the global file metadata mapping table.
[0027] When it is necessary to release cache space, retrieve the popularity score of all or some files from the global file metadata mapping table, and generate a list of files to be eliminated according to the popularity score.
[0028] Then, cache eviction is performed, sequentially removing the files with the lowest popularity scores from the list of files to be evicted until enough cache space is released. At the same time, detailed information about each eviction operation is recorded, including the filename of the deleted file, the final popularity score, the reasoning given by the large language model, and the operation timestamp.
[0029] Preferably, the adaptive learning and optimization stage further includes the following steps:
[0030] If a discarded file is re-downloaded from the cloud by the user within a preset time, a feedback signal is generated, and the erroneous discard event is recorded.
[0031] Preferably, it also includes a user rule intervention mechanism: receiving user-configured mandatory retention rules and / or score correction rules, and executing them after the large language model scores the data.
[0032] Preferably, the mandatory retention rule is to never eliminate any files in the specified directory, and the score correction rule is to set an upper limit on the popularity score of files with a preset format.
[0033] A second aspect of the present invention provides: a file access hot / cold index calculation system based on a large model, used to implement any of the above-mentioned file access hot / cold index calculation methods based on a large model, comprising:
[0034] The system initialization and monitoring configuration module is used to initialize the hot / cold index calculation algorithm, load the pre-deployed large language model, then read various running parameters from the configuration file, and monitor file operation events in the local cache directory.
[0035] The multi-dimensional feature extraction module is used to extract multi-dimensional feature vectors from target files in real time.
[0036] The dynamic prompt generation module is used to dynamically arrange multi-dimensional feature vectors into structured natural language prompts and input them into the large language model;
[0037] The popularity generation and cache management module is used to perform semantic reasoning on structured natural language prompts using a large language model, generate a popularity score for each file, and manage cache space based on the popularity score;
[0038] The adaptive learning and optimization module is used to establish an implicit user feedback loop. When the feedback signal reaches a preset value, the large language model is incrementally fine-tuned based on the collected feedback data.
[0039] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the above-described method for calculating the hotness and coldness of file access based on a large model is implemented.
[0040] The beneficial effects of this invention are:
[0041] 1) This invention utilizes the ability of large language models to understand deep information such as file semantics, path context, and item relevance, thereby achieving accurate prediction of the probability of future file access. This enables the making of optimal cache retention and eviction decisions, significantly improving cache hit rate, ensuring smooth access to users' critical data, and possessing good interpretability and adaptability to individual user habits.
[0042] 2) This invention elevates the assessment of file access frequency from a single dimension based on "access records" to a comprehensive dimension based on "semantic understanding." The large language model, like a human expert, can deeply analyze the semantic connotations (such as "core," "temporary," and "backup") of filenames and directory structures, and perform logical reasoning based on context. This makes its prediction accuracy for the future access probability of files far exceed that of traditional LRU / LFU algorithms, effectively preventing important files from being mistakenly evicted, thereby significantly improving cache hit rate and optimizing user access speed and experience for critical data.
[0043] 3) By establishing an implicit user feedback loop (such as monitoring files that are immediately re-downloaded after being discarded), the local model can be continuously fine-tuned, gradually aligning its decision-making logic with the workflow and file usage habits of specific users. This means that the system will become increasingly adaptable to different roles such as software developers, designers, or copywriters, ultimately achieving a highly personalized intelligent caching service tailored to each individual user.
[0044] 4) This invention utilizes "Chain-of-Thought" technology, allowing the model to output the rationale behind its decisions while providing a score. This makes every elimination action transparent, traceable, and auditable, greatly enhancing the system's credibility and maintainability. More importantly, because the model and all data processing flows are executed entirely locally on the user's PC, no file metadata or user behavior information needs to be uploaded to the cloud, fundamentally eliminating the risk of data leakage and fully protecting user privacy and security. Attached Figure Description
[0045] Figure 1 This is a detailed flowchart of the method of the present invention. Detailed Implementation
[0046] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] See Figure 1 The first aspect of this invention provides: a method for calculating the hotness and coldness of file access based on a large model, comprising the following steps:
[0048] During the system initialization and monitoring configuration phase, the hot / cold index calculation algorithm is initialized, the pre-deployed large language model is loaded, and then various running parameters are read from the configuration file, and file operation events in the local cache directory are monitored.
[0049] In the multi-dimensional feature extraction stage, multi-dimensional feature vectors of the target file are extracted in real time.
[0050] In the dynamic prompt generation stage, multi-dimensional feature vectors are dynamically arranged into structured natural language prompts and input into the large language model;
[0051] In the popularity generation and cache management stage, a large language model is used to perform semantic reasoning on structured natural language prompts to generate a popularity score for each file, and cache space is managed based on the popularity score.
[0052] In the adaptive learning and optimization phase, an implicit user feedback loop is established. When a preset value of feedback signal is accumulated, the large language model is incrementally fine-tuned based on the collected feedback data.
[0053] In this embodiment, the present invention is applied to intelligent cache management on a PC client. It monitors and extracts multi-dimensional, deep-level features of cached files, including but not limited to access history, file metadata, and semantic information and contextual relationships parsed from filenames and paths. Its core innovation lies in dynamically orchestrating these complex features into structured natural language prompts (Prompts) and submitting them to a large language model deployed locally on the PC for reasoning. LLM leverages its powerful semantic understanding and logical association capabilities to deeply evaluate the overall value of files and their future access probability, outputting a precise quantitative "popularity score."
[0054] This invention discloses a solution that, through a series of refined steps, elevates the calculation of file popularity from a simple numerical statistical task to a comprehensive inference task performed by a large language model. The core process of this algorithm includes: initializing and monitoring the system; defining and deeply extracting multi-dimensional feature vectors of files; dynamically generating natural language analysis prompts for LLM; calling the local LLM for inference and parsing its output; executing cache eviction decisions based on the popularity score given by the LLM; and achieving continuous learning and optimization of the algorithm through a feedback mechanism.
[0055] In some embodiments, the large language model is a lightweight model that has been distilled and compressed; the operating parameters include a warning threshold for cache space occupancy, a time interval for periodic evaluation, the path to the LLM model file, and a backup eviction algorithm; the file operation events include file opening, reading, writing, closing, renaming, and deleting.
[0056] In this embodiment, the system initialization and monitoring configuration phase includes the following: The hot / cold number calculation algorithm is initialized and runs as a background service when the PC client program starts or the user logs into the system. Model loading: The system loads a pre-deployed, lightweight or distilled large language model from a specified path on the local hard drive into the computer memory (or video memory), ready to receive inference requests.
[0057] Configuration parameter loading: Read various running parameters from the configuration file, including: the warning threshold for cache space utilization (e.g., 90%), the time interval for periodic evaluation (e.g., every 1 hour), the path to the LLM model file, and the alternative eviction algorithm (e.g., LRU).
[0058] File system I / O monitoring: By hooking into or subscribing to event notifications of POSIX-compliant clients, file operations on the local cache directory are monitored. Monitored events include: file open, read, write, close, rename, and delete.
[0059] In some embodiments, the multi-dimensional feature vector includes at least recency features, frequency features, semantic features, and contextual features; the multi-dimensional feature extraction stage further includes the following steps:
[0060] When a file access event is detected, the last access time and last modification timestamp of the accessed file are updated in real time to obtain the proximate characteristics.
[0061] A counter structure is maintained in memory for each cache file to record the number of accesses within different time windows to obtain frequency characteristics;
[0062] The filenames of the target files are segmented and matched with a predefined keyword library; then the complete directory path of the target files is analyzed, the path depth is calculated, and the keywords in the path are identified to obtain semantic features.
[0063] Based on the target file's extension, the basic importance score of the file type is retrieved from the configurable mapping table; then, the parent directories of the target file are traversed upwards to check if a project identifier file exists. If it does, the target file is marked as a project file, and finally, the context features are obtained.
[0064] In this embodiment, the multi-dimensional feature extraction stage includes the following: defining a comprehensive feature vector for each file, which contains at least four categories: recency, frequency, semantic, and contextual features.
[0065] Recency feature extraction: When a file access event is detected, the last access timestamp and last modification timestamp of the file are updated in real time.
[0066] Frequency feature extraction and maintenance: The algorithm maintains a counter structure in memory for each cache file to record the number of accesses within different time windows, such as the number of accesses in the past 1 hour, the number of accesses in the past 24 hours, and the total number of accesses in the lifetime.
[0067] Semantic feature extraction (filename analysis): The filenames are segmented and matched against a predefined keyword library. The keyword library contains positive words (such as "final", "master", "release", "core"), negative words (such as "temp", "log", "bak", "draft"), and neutral words, and assigns different weights to them.
[0068] Semantic feature extraction (path analysis): Analyze the complete directory path where the file is located. This step includes calculating the path depth and identifying keywords in the path (such as "src", "include", "core", "docs", "archive", "download"), etc.
[0069] Contextual feature extraction (file type): Based on the file extension (e.g., .docx, .pptx, .py, .go, .dll, .log), query the basic importance score of the file type from a configurable mapping table.
[0070] Contextual Feature Extraction (Project Association Analysis): The algorithm traverses the parent directories of the files upwards, searching for the existence of project identification files (such as .git directory, .idea directory, pom.xml, package.json). If found, the file is marked as a "project file," and the project name is recorded; this is an important positive feature.
[0071] In some embodiments, the dynamic prompt generation stage further includes the following steps:
[0072] When the cache space utilization exceeds the preset warning threshold or when the periodic evaluation timer is triggered, the hot / cold evaluation process for some or all cached files is initiated.
[0073] When the number of cached files exceeds the preset number of files, a candidate file set is initially selected according to preset conditions, and only the hotness and coldness of the candidate file set are evaluated.
[0074] Iterate through each candidate file and fill the multi-dimensional feature vector of each candidate file into the preset natural language prompt template to generate structured natural language prompts;
[0075] Then, the structured natural language prompts of multiple candidate documents are batch-processed and combined into a batch, which is then submitted to the large language model all at once.
[0076] In this embodiment, the dynamic generation of prompts stage includes the following: Evaluation process triggering: When the cache space usage exceeds the set warning threshold, or when the periodic evaluation timer is triggered, the hot and cold evaluation process for some or all cached files is officially started.
[0077] Candidate file selection: To optimize performance, especially when the number of cached files is huge, the algorithm can first use simple strategies such as LRU to initially select a set of candidate files that are "most likely to be eliminated" (e.g., the 20% of files that have not been accessed for the longest time), and only perform LLM evaluation on this set.
[0078] Structured Natural Language Prompt Generation: For each candidate file, all features extracted and quantified during the multi-dimensional feature extraction stage are populated into a pre-defined, structured natural language prompt template. For example: "Evaluate file popularity. File: {filename: 'renderer.cpp', path context: 'project core code directory', file type: 'C++ source code', access history: 'recently active'}. Please output a popularity score from 0.0 to 1.0 and the reasoning."
[0079] Inference request batching: To improve GPU or CPU processing efficiency, analysis hints from multiple files are combined into a batch and submitted to the large language model at once.
[0080] In some embodiments, the heat generation and cache management phase further includes the following steps:
[0081] The large language model performs independent semantic understanding and logical reasoning on the prompts after each batch processing.
[0082] The large language model outputs structured data, including a unique identifier for each candidate document, a calculated popularity score, and text of optional reasoning arguments;
[0083] The popularity score of each candidate file is updated in the global file metadata mapping table maintained by the system. If the large language model fails to return a valid popularity score for a file, the backup strategy is activated to assign a score to the file and update it in the global file metadata mapping table.
[0084] When it is necessary to release cache space, retrieve the popularity score of all or some files from the global file metadata mapping table, and generate a list of files to be eliminated according to the popularity score.
[0085] Then, cache eviction is performed, sequentially removing the files with the lowest popularity scores from the list of files to be evicted until enough cache space is released. At the same time, detailed information about each eviction operation is recorded, including the filename of the deleted file, the final popularity score, the reasoning given by the large language model, and the operation timestamp.
[0086] In this embodiment, the popularity generation and cache management phase includes the following: Calling the local LLM for inference: The loaded local LLM is called via an internal API, using batch-processed prompts as input. The LLM performs independent semantic understanding and logical inference for each prompt.
[0087] LLM Response Parsing: Receives the output from the LLM database. The output format is structured data (such as JSON), containing a unique identifier for each file, the calculated popularity score, and optional reasoning text. Parse the output to extract the necessary information.
[0088] Popularity score storage and update: The popularity score of each file obtained from LLM is updated to a global file metadata mapping table (Cache Map) maintained by the system.
[0089] Inference failure tolerance: If the LLM fails to return a valid score for a file for any reason (such as model error or timeout), the algorithm will activate a backup strategy. For example, it may directly assign a default low score to the file, or use the file's LRU / LFU ranking as its temporary score to ensure the robustness of the elimination process.
[0090] Generate elimination sequence: When space needs to be freed up, the algorithm retrieves the popularity scores of all (or candidate) files from the metadata mapping table and generates a list of files to be eliminated in ascending order of scores.
[0091] Perform cache eviction: The algorithm sends file deletion commands to the POSIX client sequentially, starting from the top of the generated eviction list, until enough cache space is freed up.
[0092] Operation log recording: Detailed information for each elimination operation, including the deleted file name, its final popularity score, the reasoning given by LLM (if any), and the operation timestamp, will be recorded in the log file for subsequent auditing and analysis.
[0093] In some embodiments, the adaptive learning and optimization phase further includes the following steps:
[0094] If a discarded file is re-downloaded from the cloud by the user within a preset time, a feedback signal is generated, and the erroneous discard event is recorded.
[0095] In this embodiment, the adaptive learning and optimization phase includes the following: establishing an implicit user feedback loop: the algorithm continuously monitors user behavior. For example, if a recently discarded file is quickly re-downloaded from the cloud by the user, this constitutes a strong negative feedback signal. The system records such "erroneous discard" events.
[0096] Model incremental fine-tuning: After accumulating enough feedback signals (such as "erroneous elimination" cases), the system can use this data in the background to perform incremental fine-tuning on the local LLM, making its decision-making logic more in line with the work habits of specific users.
[0097] In some embodiments, a user rule intervention mechanism is also included: receiving user-configured mandatory retention rules and / or score correction rules, and executing them after the large language model scores the data.
[0098] In this embodiment, users are allowed to define custom rules: the system provides a user interface or configuration file that allows users to define high-priority rules, such as "never eliminate any files in the specified directory" or "the maximum popularity score for all .log files is 0.2". These rules will be executed after LLM scoring and will serve as the basis for vetoing or adjusting the final decision.
[0099] The present invention also includes the following steps: Periodic global re-evaluation stage: Even if the cache pressure is not high, a comprehensive re-evaluation of the popularity of all files in the cache should be carried out according to the set period to prevent the file popularity information from becoming outdated due to the lack of eviction operations for a long time.
[0100] This invention creatively reconstructs file popularity assessment from a "statistical problem" based on historical access records into a "semantic reasoning problem" based on multi-dimensional features. In the field of cache management, it is the first to use the semantic information and contextual associations (such as project ownership) contained in unstructured text such as filenames and directory paths as core features, and to use them as key inputs for decision-making in large language models.
[0101] In some embodiments, the mandatory retention rule is to never eliminate all files in a specified directory, and the score correction rule is to set an upper limit on the popularity score of files with a preset format.
[0102] A second aspect of the present invention provides: a file access hot / cold index calculation system based on a large model, used to implement any of the above-mentioned file access hot / cold index calculation methods based on a large model, comprising:
[0103] The system initialization and monitoring configuration module is used to initialize the hot / cold index calculation algorithm, load the pre-deployed large language model, then read various running parameters from the configuration file, and monitor file operation events in the local cache directory.
[0104] The multi-dimensional feature extraction module is used to extract multi-dimensional feature vectors from target files in real time.
[0105] The dynamic prompt generation module is used to dynamically arrange multi-dimensional feature vectors into structured natural language prompts and input them into the large language model;
[0106] The popularity generation and cache management module is used to perform semantic reasoning on structured natural language prompts using a large language model, generate a popularity score for each file, and manage cache space based on the popularity score;
[0107] The adaptive learning and optimization module is used to establish an implicit user feedback loop. When the feedback signal reaches a preset value, the large language model is incrementally fine-tuned based on the collected feedback data.
[0108] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the above-described method for calculating the hotness and coldness of file access based on a large model is implemented.
[0109] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. A method for calculating the hotness and coldness of file access based on a large model, characterized in that: Includes the following steps: During the system initialization and monitoring configuration phase, the hot / cold index calculation algorithm is initialized, the pre-deployed large language model is loaded, and then various running parameters are read from the configuration file, and file operation events in the local cache directory are monitored. In the multi-dimensional feature extraction stage, multi-dimensional feature vectors of the target file are extracted in real time; the multi-dimensional feature vectors include at least recency features, frequency features, semantic features, and contextual features. In the dynamic prompt generation stage, multi-dimensional feature vectors are dynamically arranged into structured natural language prompts and input into the large language model; In the popularity generation and cache management stage, a large language model is used to perform semantic reasoning on structured natural language prompts to generate a popularity score for each file, and cache space is managed based on the popularity score; the popularity generation and cache management stage also includes the following steps: The large language model performs independent semantic understanding and logical reasoning on the prompts after each batch processing. The large language model outputs structured data, including a unique identifier for each candidate document, a calculated popularity score, and text of optional reasoning arguments; The popularity score of each candidate file is updated in the global file metadata mapping table maintained by the system. If the large language model fails to return a valid popularity score for a file, the backup strategy is activated to assign a score to the file and update it in the global file metadata mapping table. When it is necessary to release cache space, retrieve the popularity score of all or some files from the global file metadata mapping table, and generate a list of files to be eliminated according to the popularity score. Then, cache eviction is performed, sequentially removing the files with the lowest popularity scores from the list of files to be evicted until enough cache space is freed up; at the same time, detailed information about each eviction operation is recorded, including the file name of the deleted file, the final popularity score, the reasoning given by the large language model, and the operation timestamp; In the adaptive learning and optimization phase, an implicit user feedback loop is established. When a preset value of feedback signal is accumulated, the large language model is incrementally fine-tuned based on the collected feedback data.
2. The method for calculating file access hotness / coldness based on a large model according to claim 1, characterized in that: The large language model is a lightweight model that has been distilled and compressed; the operating parameters include a warning threshold for cache space occupancy, a periodic evaluation time interval, the path to the LLM model file, and a backup eviction algorithm; the file operation events include file opening, reading, writing, closing, renaming, and deleting.
3. The method for calculating file access hotness / coldness based on a large model according to claim 1, characterized in that: The multi-dimensional feature extraction stage also includes the following steps: When a file access event is detected, the last access time and last modification timestamp of the accessed file are updated in real time to obtain the proximate characteristics. A counter structure is maintained in memory for each cache file to record the number of accesses within different time windows to obtain frequency characteristics; The filenames of the target files are segmented and matched with a predefined keyword library; then the complete directory path of the target files is analyzed, the path depth is calculated, and the keywords in the path are identified to obtain semantic features. Based on the target file's extension, the basic importance score of the file type is retrieved from the configurable mapping table; then, the parent directories of the target file are traversed upwards to check if a project identifier file exists. If it does, the target file is marked as a project file, and finally, the context features are obtained.
4. The method for calculating file access hotness / coldness based on a large model according to claim 1, characterized in that: The dynamic prompt generation stage also includes the following steps: When the cache space utilization exceeds the preset warning threshold or when the periodic evaluation timer is triggered, the hot / cold evaluation process for some or all cached files is initiated. When the number of cached files exceeds the preset number of files, a candidate file set is initially selected according to preset conditions, and only the hotness and coldness of the candidate file set are evaluated. Iterate through each candidate file and fill the multi-dimensional feature vector of each candidate file into the preset natural language prompt template to generate structured natural language prompts; Then, the structured natural language prompts of multiple candidate documents are batch-processed and combined into a batch, which is then submitted to the large language model all at once.
5. The method for calculating file access hotness / coldness based on a large model according to claim 1, characterized in that: The adaptive learning and optimization phase also includes the following steps: If a discarded file is re-downloaded from the cloud by the user within a preset time, a feedback signal is generated, and the erroneous discard event is recorded.
6. The method for calculating file access hotness / coldness based on a large model according to any one of claims 1-5, characterized in that: It also includes a user rule intervention mechanism: receiving user-configured mandatory retention rules and / or score correction rules, and executing them after the large language model scores the data.
7. The method for calculating file access hotness / coldness based on a large model according to claim 6, characterized in that: The mandatory retention rule means that all files in the specified directory will never be deleted, and the score correction rule means that an upper limit is set on the popularity score of files with preset formats.
8. A file access hot / coldness calculation system based on a large model, characterized in that: To implement the file access hot / coldness calculation method based on a large model as described in any one of claims 1-7, the method includes: The system initialization and monitoring configuration module is used to initialize the hot / cold index calculation algorithm, load the pre-deployed large language model, then read various running parameters from the configuration file, and monitor file operation events in the local cache directory. A multi-dimensional feature extraction module is used to extract multi-dimensional feature vectors of target files in real time; the multi-dimensional feature vectors include at least proximal features, frequency features, semantic features, and contextual features. The dynamic prompt generation module is used to dynamically arrange multi-dimensional feature vectors into structured natural language prompts and input them into the large language model; The popularity generation and cache management module is used to perform semantic reasoning on structured natural language prompts using a large language model, generate a popularity score for each file, and manage cache space based on the popularity score; specifically, it includes the following steps: The large language model performs independent semantic understanding and logical reasoning on the prompts after each batch processing. The large language model outputs structured data, including a unique identifier for each candidate document, a calculated popularity score, and text of optional reasoning arguments; The popularity score of each candidate file is updated in the global file metadata mapping table maintained by the system. If the large language model fails to return a valid popularity score for a file, the backup strategy is activated to assign a score to the file and update it in the global file metadata mapping table. When it is necessary to release cache space, retrieve the popularity score of all or some files from the global file metadata mapping table, and generate a list of files to be eliminated according to the popularity score. Then, cache eviction is performed, sequentially removing the files with the lowest popularity scores from the list of files to be evicted until enough cache space is freed up; at the same time, detailed information about each eviction operation is recorded, including the file name of the deleted file, the final popularity score, the reasoning given by the large language model, and the operation timestamp; The adaptive learning and optimization module is used to establish an implicit user feedback loop. When the feedback signal reaches a preset value, the large language model is incrementally fine-tuned based on the collected feedback data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the file access hot / cold index calculation method based on a large model as described in any one of claims 1-7.
Citation Information
Patent Citations
Data updating method and device, equipment, storage medium and program product
CN118861071A
Method, system and device for improving retrieval performance of RAG knowledge base and medium
CN118981511A