Multi-level cache access method, system and equipment and storage medium
By searching for inference results of feature vectors in multi-level caches and semantic partition matching, combined with large language models and database guarantees, the response latency problem of existing caching architectures under high-frequency requests is solved, and efficient and reliable risk control decisions are achieved.
Patent Information
- Application Number
- CN202511959390.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-12-24
AI Technical Summary
Existing caching architectures suffer from excessively long response times during high-frequency repetitive requests and peak customer periods such as holidays, making it difficult to meet the high redundancy and high real-time requirements of cached data inference.
The inference result corresponding to the feature vector is searched in the first preset cache. If no match is found, the semantic partition is found in the second preset cache and the historical cache vector is determined. The final result is determined by combining similarity calculation. If necessary, the large language model is called to perform end-to-end inference, and the database is used to ensure eventual consistency.
It improves the hit rate of cached data inference, shortens the inference time of user review requests, reduces response latency, meets the requirements of high redundancy and high real-time performance, and ensures the reliability and availability of risk control decisions when the cache expires.
Smart Images

Figure CN121387772A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data cache access, in particular to a multi-level cache access method, system, device and storage medium. BACKGROUND
[0002] In the automobile financial loan business, after the customer submits a loan application, the system needs to call a large model in real time to comprehensively analyze the multi-dimensional data of the user's credit record, income level, vehicle valuation, historical default situation, etc., and output risk score and credit decision. This process involves high complexity model inference calculation, with significant computing-intensive characteristics.
[0003] To alleviate the computing load and improve response efficiency, the existing system generally adopts a three-level cache architecture: L1 local cache is used to store session-level or temporary data; L2 distributed cache (such as Redis) is used to share high-frequency access results; L3 database is used as a persistent layer to save complete risk assessment records, and through a timing synchronization mechanism, the upper layer cache is kept consistent, to a certain extent, reducing database access frequency and part of the repeated calculation overhead.
[0004] However, L1 only caches raw data, and high-frequency repeated inference still exists. L2 will still trigger model inference when similar requests are received. Therefore, the existing cache architecture only caches data, especially during the holiday customer peak period, the request for cache data inference is highly repetitive, resulting in a long response delay, which is difficult to meet the high redundancy and high real-time requirements of cache data inference. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a multi-level cache access method, system, device and storage medium, by finding the corresponding inference result of the user audit request in the first preset cache or the second preset cache, to improve the hit rate of the inference result of the user audit request in the cache data, shorten the inference time of the user audit request, reduce the degree of repetition of data inference, and reduce the response delay, so as to meet the high redundancy and high real-time requirements of cache data inference.
[0006] To achieve the above object, in a first aspect, embodiments of the present application provide a multi-level cache access method, the method comprising: obtaining a key field in a user audit request and converting the key field into a feature vector; searching for an inference result corresponding to the feature vector in a first preset cache; the first preset cache recording a correspondence between feature vectors and inference results; in the case that the inference result corresponding to the feature vector exists in the first preset cache, returning the inference result corresponding to the feature vector to the user; in the case that the inference result corresponding to the feature vector does not exist in the first preset cache, finding a semantic partition corresponding to the feature vector in a second preset cache, and determining a historical cache vector corresponding to the feature vector and an inference result corresponding to the historical cache vector from the semantic partition; the second preset cache recording a plurality of semantic partitions and a correspondence between historical cache vectors and inference results under each semantic partition; and determining the inference result corresponding to the feature vector according to the feature vector, the historical cache vector and the inference result corresponding to the historical cache vector.
[0007] In the present embodiment, by obtaining a feature vector corresponding to a key field of a user audit request, searching for a corresponding inference result in a first preset cache, if the corresponding inference result is not found in the first preset cache, in a second preset cache, a historical cache vector corresponding to the feature vector is found according to a historical cache vector corresponding to a semantic partition, and then an inference result corresponding to the historical cache vector is found, and the inference result corresponding to the historical cache vector is taken as an inference result of the feature vector, so that the inference result corresponding to the user audit request is quickly determined. In this way, by finding the corresponding inference result of the user audit request in the first preset cache or the second preset cache, the hit rate of the inference result of the user audit request in the cache data is improved, the inference time of the user audit request is shortened, the degree of repetition of data inference is reduced, and the response delay is reduced, thereby meeting the high redundancy and high real-time requirement of cache data inference.
[0008] In some embodiments, the finding of the corresponding semantic partition of the feature vector in the second preset cache and the determination of the historical cache vector corresponding to the feature vector and the inference result corresponding to the historical cache vector from the semantic partition comprise: calculating the similarity of the feature vector and a center vector of each semantic partition in the second preset cache; the center vector being a weighted average of all vectors in the semantic partition; taking the semantic partition corresponding to the center vector with the highest similarity to the feature vector as the semantic partition corresponding to the feature vector; calculating the similarity of each historical cache vector in the semantic partition corresponding to the feature vector and the feature vector; taking the historical cache vector with the highest similarity to the feature vector as the historical cache vector corresponding to the feature vector, and obtaining the inference result corresponding to the historical cache vector.
[0009] In this way, by first finding the semantic partition to which the feature vector belongs, and then finding the corresponding historical cache vector in the semantic partition, the inference result corresponding to the found historical cache vector is taken as the inference result corresponding to the feature vector, forming a two-level search strategy of first partitioning and then local retrieval, effectively balancing the retrieval accuracy and performance overhead, and realizing efficient approximate matching in a large-scale cache environment, providing scalable technical support for high-concurrency automobile financial risk control scenarios.
[0010] In some embodiments, the determining of the target cache result corresponding to the user review request according to the feature vector, the historical cache vector, and the inference result corresponding to the historical cache vector comprises: in a case where the similarity between the feature vector and the historical cache vector is greater than or equal to a set threshold, returning the inference result corresponding to the historical cache vector to the user as the target cache result; in a case where the similarity between the feature vector and the historical cache vector is less than the set threshold, inputting the user review request into a pre-trained large language model to obtain the inference result corresponding to the feature vector.
[0011] In this way, instead of relying on cache results, the original user review request is re-encapsulated and input into a pre-trained large language model to trigger a brand-new end-to-end inference process, so as to generate an inference result accurately reflecting the current user status, to back up in case of cache invalidation, and to ensure the reliability of the risk control system at the premise of sacrificing a certain response speed, realizing dynamic switching between intelligent caching and accurate calculation.
[0012] In some embodiments, after the determination of the inference result corresponding to the feature vector, the method further comprises: storing the feature vector and the inference result corresponding to the feature vector into a database; and generating the first preset cache and the second preset cache according to the feature vectors and inference results currently stored in the database every preset time interval.
[0013] In this way, by refreshing the first preset cache and the second preset cache at intervals of a preset time interval, it is helpful to eliminate cache bias caused by missing or abnormalities in incremental updates, especially providing reliable data recovery capability in the system restart or cold start stage, and enhancing the robustness and maintainability of the overall architecture.
[0014] In some embodiments, the database is arranged in a server, and the generating of the first preset cache and the second preset cache according to the feature vectors and inference results currently stored in the database comprises: in a case where the current load state of the server is low load, generating the first preset cache and the second preset cache according to the feature vectors and inference results in the database whose call frequency is higher than a preset frequency.
[0015] In this way, high-frequency data is preferentially selected to construct the core content of the first preset cache and the second preset cache, ensuring that cache preheating focuses on hotspot requests with the highest reuse value, avoiding performance interference caused by large-scale data processing during high load, and achieving peak-shaving utilization of computing resources.
[0016] In some embodiments, the method further comprises: in the case where the first preset cache and the second preset cache are both in an expired state, obtaining the inference result corresponding to the feature vector from the database; if the inference result corresponding to the feature vector is not obtained from the database, inputting the user audit request into a pre-trained large language model to obtain the inference result corresponding to the feature vector; in the case where the first preset cache is in an expired state and the second preset cache is not in an expired state, finding the semantic partition corresponding to the feature vector in the second preset cache; in the case where the first preset cache is not in an expired state and the second preset cache is in an expired state, if the inference result corresponding to the feature vector is not found in the first preset cache, obtaining the inference result corresponding to the feature vector from the database; if the inference result corresponding to the feature vector is not obtained from the database, inputting the user audit request into a pre-trained large language model to obtain the inference result corresponding to the feature vector.
[0017] In this way, the database is used as a data source for the final consistency guarantee, and is only enabled when all levels of cache are invalid or not covered, ensuring that even after the cache refresh window period or abnormal interruption, the correct risk control decision result can still be obtained through the database, meeting the stringent requirements of financial-level applications for high availability.
[0018] In some embodiments, the finding in the first preset cache whether the inference result corresponding to the feature vector exists comprises: in the case where the first preset cache is not in an expired state, finding in the first preset cache whether the inference result corresponding to the feature vector exists; and the finding in the second preset cache the semantic partition corresponding to the feature vector comprises: in the case where the second preset cache is not in an expired state, finding in the second preset cache the semantic partition corresponding to the feature vector.
[0019] In this way, the cache access operation is subjected to a preposed validity check, the control granularity of data consistency is strengthened, invalid queries on obsolete first preset caches and second preset caches are effectively prevented, the generation of false positives or misleading results is avoided, semantic partition mismatches or index invalidation problems caused by the use of expired metadata are fundamentally eliminated, and the reliability and security of the entire multi-level cache system are improved.
[0020] In a second aspect, an embodiment of the present application provides a multi-level cache access system, comprising: an acquisition module, configured to acquire a key field in a user audit request and convert the key field into a feature vector; a first cache module, configured to search the first preset cache for whether there is an inference result corresponding to the feature vector; the first preset cache records a correspondence between a feature vector and an inference result; in the case that the first preset cache has the inference result corresponding to the feature vector, the inference result corresponding to the feature vector is returned to the user; a second cache module, configured to, in the case that the first preset cache does not have the inference result corresponding to the feature vector, find a semantic partition corresponding to the feature vector in the second preset cache, and determine a historical cache vector corresponding to the feature vector and an inference result corresponding to the historical cache vector from the semantic partition; the second preset cache records a plurality of semantic partitions and a correspondence between a historical cache vector and an inference result under each semantic partition; and the inference result corresponding to the feature vector is determined according to the feature vector, the historical cache vector and the inference result corresponding to the historical cache vector.
[0021] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program capable of being executed by the processor, and the processor can execute the computer program to implement the multi-level cache access method according to the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the multi-level cache access method according to the first aspect.
[0023] In order to make the above objectives, characteristics and advantages of the present application more apparent and understandable, the following will describe preferred embodiments in detail, and the accompanying drawings will be described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments, and it should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0025] Figure 1 A multi-level cache access method flowchart provided by an embodiment of the present application; Figure 2 A flowchart of sub-steps S401-S404 of step S400 in the method; Figure 1 Figure 3 Figure 1 Flowchart of sub-steps S501-S502 in step S500; Figure 4 Flowchart of updating the first preset cache and the second preset cache provided by the embodiment of the present application; Figure 5 Flowchart of sub-step S521 in step S520; Figure 4 Flowchart of sub-step S521 in step S520; Figure 6 Flowchart of sub-steps S522-S524 in step S520; Figure 4 Flowchart of sub-steps S522-S524 in step S520; Figure 7 Flowchart of another multi-level cache access method provided by the embodiment of the present application; Figure 8 Functional module schematic diagram of the multi-level cache access system provided by the embodiment of the present application; Figure 9 Block schematic diagram of the electronic device provided by the embodiment of the present application.
[0026] Icon: 1000-multi-level cache access system; 1100-acquisition module; 1200-first cache module; 1300-second cache module; 1400-synchronization module; 2000-electronic device; 2100-processor; 2200-memory; 2300-bus; 2400-communication interface. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0028] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents 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 creative labor are within the scope of protection of the present application.
[0029] It is to be noted that the relational terms herein, such as first and second and the like, are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0030] As described in the background, only the original data is cached locally, and high-frequency repeated inference still exists. Distributed caching still triggers model inference when similar requests are made. Therefore, the existing cache architecture only caches data, especially during the peak access period of holidays when the customer is concentrated. The request for inference of cached data is highly repetitive, resulting in excessively long response delays, making it difficult to meet the high redundancy and high real-time requirements of cached data inference.
[0031] To this end, an embodiment of the present application provides a multi-level cache access method, which is described with reference to Figure 1 , Figure 1 A flowchart of a multi-level cache access method provided by an embodiment of the present application is shown in FIG. 1. The multi-level cache access method includes steps S100-S500. S100, obtaining a key field in a user audit request and converting the key field into a feature vector.
[0032] In this embodiment, in the automobile financial business, the loan audit request submitted by the user contains core information for risk assessment such as credit scoring, occupation type, income level, historical overdue records, and vehicle valuation. Therefore, these key fields are extracted from the user audit request body, and standardized and numerical encoding processing is performed on them through a feature extraction module. In specific implementation, a weighted fusion method is used to map multi-dimensional heterogeneous data into a fixed-dimensional high-dimensional numerical sequence, i.e., a feature vector. The feature vector, as a mathematical representation of the user credit portrait, has semantic comparability and provides a basic input for subsequent cache matching based on similarity. It should be noted that this conversion process realizes the transition from discrete parameters to continuous space coordinates, which can identify requests with similar risk characteristics despite different parameters, thereby improving the possibility of result reuse.
[0033] S200, checking whether the inference result corresponding to the feature vector exists in the first preset cache; the first preset cache records the correspondence between the feature vector and the inference result.
[0034] In the present embodiment, the feature vector is indexed, and hit detection is performed in the first preset cache in the local memory. The first preset cache can be a local cache. The first preset cache herein is defined as a high-speed key-value storage structure deployed on the application server side, which internally maintains a direct mapping relationship between the historically generated feature vectors and their corresponding large language model inference results. Specifically, a hash operation is performed on the feature vector to generate a unique retrieval key, and it is queried whether the key exists in the current cache space. If it exists and the associated data is not expired, it is determined as a hit; otherwise, the next level of access process is entered to constitute the fastest response path in the multi-level cache system, which is suitable for highly similar request scenarios that repeatedly occur within a short period of time.
[0035] S300, in the case where the inference result corresponding to the feature vector exists in the first preset cache, returning the inference result corresponding to the feature vector to the user.
[0036] In the present embodiment, the inference result bound with the feature vector is read from the first preset cache, and the result is the previously completed risk classification conclusion and related decision suggestions. In this process, no remote call or model calculation is triggered, and the inference result is directly packaged into a standard format and returned to the client. The entire process takes very short time and is usually completed in milliseconds. It can be understood that this step fully utilizes the low latency advantage of the local cache, effectively avoids the resource waste caused by repeated inference, and significantly improves the service efficiency in high-frequency scenarios.
[0037] In some embodiments, the number of times each feature vector and the corresponding inference result in the first preset cache are called is obtained; the retention time of the feature vectors and the corresponding inference results in the first preset cache that are not called is obtained; and the feature vectors and the corresponding inference results whose retention time is greater than a preset time and whose number of times called is greater than a preset number of times are removed.
[0038] In the present embodiment, the first preset cache is a high-speed memory storage area deployed locally on the application server, and its physical capacity is limited and cannot be expanded indefinitely to accommodate all historically generated feature vectors and inference results. Therefore, a dynamic management mechanism needs to be established to ensure that the cache space continues to operate efficiently in a high-concurrency scenario. Specifically, by monitoring the access behavior of each cache entry, the cumulative number of hits and calls is recorded, which reflects the reuse heat of the entry in the business traffic. At the same time, the cache entries that have not been accessed for a long time are tracked, and the retention time since writing is calculated, i.e., the time difference from the last write or update time to the current clock. On this basis, two key control parameters are set: the preset time is used to define the maximum survival period of the data, and the preset number represents the threshold for an entry to enter a low-frequency use stage although it has been accessed multiple times. When a cache entry meets both conditions of the retention time being greater than the preset time and the number of calls being greater than the preset number, it indicates that the data was once a hot spot but has now stabilized and is no longer frequently used, and continuing to keep it in the local cache will occupy valuable resources. Therefore, it is marked as a recyclable object and triggers a cleanup operation to release its occupied memory space. It should be noted that this cleanup strategy is not simply based on the expiration time or the minimum access frequency to delete entries, but combines the dual judgment logic of usage history intensity and recent activity, avoiding the deletion of potentially re-heated warm data, achieving fine-grained management of local cache resources, and improving the overall utilization and life cycle management level of the cache while ensuring high-frequency access performance.
[0039] S400, in the case that the inference result corresponding to the feature vector does not exist in the first preset cache, finding the semantic partition corresponding to the feature vector in the second preset cache, and determining the historical cache vector corresponding to the feature vector and the inference result corresponding to the historical cache vector from the semantic partition.
[0040] In the present embodiment, the second preset cache records a plurality of semantic partitions and the corresponding relationship between the historical cache vectors and the inference results under each semantic partition. When the local cache is not hit, the second preset cache of the distributed level is entered for further retrieval. Therefore, instead of relying on exact matching, an approximate search mechanism based on semantic similarity is enabled. The second preset cache here is defined as a distributed cache shared across nodes, and its data organization uses a semantic partition structure, with each partition representing a user group with common risk characteristics. In specific implementation, according to the content attributes of the current feature vector, the semantic partition to which it is most likely to belong is located, and the historical cache vector closest in semantics is searched within the partition. The historical cache vector is an effective feature representation generated by a past request, and its inference result together form a reusable data unit. As can be seen, this step expands the matching boundary of the traditional cache, supports result sharing across Keys, and improves the overall cache utilization.
[0041] S500, determining the inference result corresponding to the feature vector according to the feature vector, the historical cache vector, and the inference result corresponding to the historical cache vector.
[0042] In this embodiment, the consistency is evaluated by comprehensively considering the current feature vector, the retrieved historical cache vector, and the inference result thereof. Specifically, the cosine similarity between them is calculated to quantify their closeness in the high-dimensional space. The similarity value is used as a key basis for judging whether to reuse the existing result, so as to determine the inference result corresponding to the feature vector by similarity judgment.
[0043] In some embodiments, for step S400, a possible implementation of the embodiment of the present application is provided, which is described with reference to Figure 2 , Figure 2 For Figure 1 the flowchart of sub-steps S401-S404 of step S400 in the above embodiment, steps S401-S404 include: S401, calculating the similarity between the feature vector and the center vector of each semantic partition in the second preset cache.
[0044] In this embodiment, all established semantic partitions in the second preset cache are traversed, and the center vector maintained by each partition is read. The center vector here is defined as the weighted average value of all historical cache vectors in the semantic partition calculated by time decay weight or other statistical rules, reflecting the overall semantic tendency of the partition. Then, the cosine similarity function is used to calculate the cosine value of the included angle between the current feature vector and each center vector. This batch comparison process aims to quickly filter out the most potential target area, narrow the subsequent search range, and realize efficient convergence from the global cache space to the local high-correlation area.
[0045] S402, taking the semantic partition corresponding to the center vector with the highest similarity to the feature vector as the semantic partition corresponding to the feature vector.
[0046] In this embodiment, all calculated similarity values are compared to identify the semantic partition corresponding to the maximum value. Specifically, the partition where the center vector with the highest similarity to the current feature vector is selected as the target retrieval domain of this request. This partition is regarded as the data set most likely to contain semantically similar cache items. It should be noted that this selection is based on the principle of maximum similarity, which ensures that the subsequent local retrieval is carried out in the most potential range to complete the key jump of semantic routing, and is the core link connecting the global structure and local data.
[0047] S403, calculating the similarity between each historical cache vector in the semantic partition corresponding to the feature vector and the feature vector.
[0048] In this embodiment, in the selected semantic partition, the historical cache vectors stored therein are read one by one, and the cosine similarity scores between the current feature vector and each of the historical cache vectors are calculated respectively. This process covers all or part of the candidates selected by the Approximate Nearest Neighbor (ANN) algorithm in the partition, ensuring that the best matching result can be identified. In this way, by performing comprehensive comparison in a smaller range, the calculation overhead can be controlled while ensuring accuracy, enabling deep search in a highly relevant subset and laying the foundation for subsequent optimal item selection.
[0049] S404, the historical cache vector with the highest similarity to the feature vector is selected as the historical cache vector corresponding to the feature vector, and the inference result corresponding to the historical cache vector is obtained.
[0050] In this embodiment, all similarity values are compared, the item with the maximum value is identified, and the corresponding vector is determined as the best matching item of the current feature vector, i.e., the historical cache vector. The historical cache vector is an effective feature representation generated by a past request, and the inference result thereof forms a complete entry saved in the second preset cache. Then, the inference result is read from the second preset cache as a candidate output. It should be noted that the inference result has been verified by the complete model in the early stage and has the premise of reuse. As can be seen, this step completes the selection process from the candidate set to a single optimal item, which is a key implementation node of semantic-level cache reuse.
[0051] By way of example, the semantic partition divides the cache space into multiple "semantic partitions". Each partition corresponds to a type of task with similar semantic features, such as risk level, business type, loan amount range, etc. The partitions can be dynamically maintained in the following ways: based on business labels (such as low-risk loans, medium-risk loans, credit loans, etc.); or automatically formed by clustering algorithms (such as K-Means). Within each partition, cache items are stored in the form of feature vectors plus inference results, for example, when a new user audit request arrives, the feature vector of the user audit request is first generated; according to its business label or historical similar partition pointer, the semantic partition to which it belongs is determined; then vector retrieval is performed in the semantic partition, and the similarity with the existing historical cache vector is calculated; if the similarity is greater than a set threshold (for example, 0.9), it is considered "semantically equivalent", and the cache result is directly returned; if it is not hit, the model is called to calculate the new result and write it into the partition. Specifically, if the similarity is between 0.7 and 0.9, a low-precision result can be reused; if the similarity is less than 0.7, the large language model is called for inference and the cache is updated (i.e., the active write-in mechanism).
[0052] In some embodiments, for step S500, a possible implementation of the embodiment of the present application is provided, which is described with reference to Figure 3 , Figure 3 Figure 1 The flowchart of the sub-steps S501-S502 of the step S500 includes: S501, in the case that the similarity between the feature vector and the historical cache vector is greater than or equal to a set threshold, returning the inference result corresponding to the historical cache vector to the user as the target cache result.
[0053] In the embodiment, the similarity between the current feature vector and the historical cache vector is compared with a preset determination boundary, and the set threshold is defined as a floating point number between 0 and 1, which is used to determine whether the two requests have sufficient consistency to support result reuse. When it is detected that the similarity is greater than or equal to the set threshold, it is determined that the two are highly consistent in risk features, and therefore the inference result corresponding to the historical cache vector is directly returned as the target cache result of the current request. This mechanism avoids repeated model calls in the case of high semantic similarity, fully utilizes the cache value, realizes result sharing of similar requests, and improves resource utilization.
[0054] S502, in the case that the similarity between the feature vector and the historical cache vector is less than the set threshold, inputting the user audit request into the pre-trained large language model to obtain the inference result corresponding to the feature vector.
[0055] In the embodiment, it is determined that the current user audit request and the existing cache item have significant differences, and forced reuse may lead to an increase in misjudgment risk. In this case, the cache path is abandoned, and the original user audit request is re-packaged and submitted to the pre-trained large language model. The large language model is trained based on massive financial risk control data and has end-to-end analysis capability, and can generate accurate risk assessment conclusions by comprehensively analyzing various input features. After the large language model completes the inference, a new inference result is output, which can be used to update the cache at various levels. It should be noted that this branch logic constitutes a bottom-up processing mechanism after cache invalidation, which ensures the accuracy of risk control judgment at the expense of certain response speed, and ensures reliable service when facing new and different requests.
[0056] In some embodiments, after determining the inference result corresponding to the feature vector, the embodiment of the present application provides updating the feature vector and the inference result in the first preset cache and the second preset cache, which is described in detail with reference to Figure 4 , Figure 4 The flowchart of updating the first preset cache and the second preset cache provided by the embodiment of the present application includes steps S510-S520: S510, storing the feature vector and the inference result corresponding to the feature vector into the database.
[0057] In this embodiment, regardless of whether the inference result comes from cache reuse or but language model calculation, it is necessary to ensure that important decision data is persisted. Therefore, after completing each request processing, the current generated feature vector and its corresponding inference result are packaged into a complete record and written to the background database. This operation ensures that all risk control decisions can be traced back, and provides original evidence for subsequent cache reconstruction, data analysis and regulatory audit, establishing a transformation channel from temporary calculation results to long-term data assets.
[0058] S520, every preset time length, generate a first preset cache and a second preset cache according to the feature vectors and inference results currently stored in the database.
[0059] In this embodiment, in order to ensure the consistency of the cache state and the underlying data, a periodic reconstruction mechanism is set. Therefore, a background timing task is configured, which is triggered periodically according to a fixed preset time length, for example, once every hour or every day. In each task running, all or part of the feature vectors and inference result records currently stored in the database are read in batches. In specific implementation, based on this batch of latest data set, the content structure of the first preset cache and the second preset cache is reconstructed. For the first preset cache, it is filled with the representative entry set in the latest snapshot; for the second preset cache, the semantic clustering analysis is re-executed according to all the data, the new semantic partition is divided, and the independent vector index structure is constructed for each partition, so as to realize the periodic refreshing of the cache topology structure, which helps to eliminate the state deviation caused by the omission of incremental update.
[0060] Exemplarily, in the multi-level cache system, the consistency maintenance of data not only involves the efficiency of cache hit and result return, but more importantly, after the underlying data changes, how to ensure that the first preset cache and the second preset cache can perceive and synchronize the latest state in time. Therefore, the traditional timing refresh or passive expiration mechanism is abandoned, and an event-driven update mode actively triggered by the database is adopted. Specifically, when the database performs a write or update operation on a certain risk control result, credit score or loan review conclusion, a structured data change event is automatically generated. The event contains three core information: the unique identifier of the modified data (such as user request ID or feature vector hash value), the new version number generated by this update, and the corresponding timestamp. The version number described herein is defined as an incremental value or a globally unique marker for identifying the life cycle stage of data, and any valid change will generate a new version state. The data change event is published to the event bus through a high-reliability message middleware (such as Kafka or RabbitMQ), forming a low-latency, persistent asynchronous notification channel. The first preset cache and the second preset cache continuously listen to the message stream as independent nodes, and judge whether the stored content is affected according to the data identifier in the event. Once a match is successful, a lightweight verification process is started. In this process, the first preset cache first checks whether the corresponding data entry exists locally, if it exists, extracts the current saved version number, and compares it with the latest version number carried in the event; if they are inconsistent, the data entry is marked as “to be refreshed”. Similarly, the second preset cache also performs the same version comparison logic, but since it uses semantic partitioning organization internally, it also needs to further locate the semantic partition to which the data belongs, and perform local cleaning or marking on the vector index structure in the partition. It should be noted that this verification process only involves metadata comparison and does not require immediate reloading of data, so it can be completed in a very short time without affecting the response performance of the main link. For the cache entries that have been determined to be expired, the refresh task associated with them is pushed to the asynchronous queue for batch processing by the background thread pool. When the refresh task is executed, the latest version of the inference result is pulled from the database, and the feature vector is recalculated as needed, and then the new data is written back to the first preset cache and the second preset cache. When writing to the second preset cache, the vector index tree (such as HNSW or FAISS structure) in the semantic partition is also updated synchronously to ensure the accuracy of subsequent similarity retrieval. As can be seen, this mechanism realizes the near real-time linkage between the cross-layer cache and the database, avoiding the “dirty read” phenomenon caused by cache delay. It can be understood that by introducing the active notification and version comparison dual mechanism, a closed-loop cache update path is constructed, so that the first preset cache and the second preset cache can quickly converge to the latest state after the data source changes, thereby ensuring the data reliability and consistency of the entire risk control decision link.
[0061] In some embodiments, for step S520, the database is set in the server, and one possible implementation of the embodiment of the present application is provided, refer to Figure 5 , Figure 5 For Figure 4 The flowchart of substep S521 of step S520 in the embodiment, step S521 includes: S521, in the case that the current load state of the server is in a low load state, generating the first preset cache and the second preset cache according to the feature vectors and the inference results whose call frequencies are higher than a preset frequency in the database.
[0062] In the embodiment, considering that cache reconstruction is a resource-intensive operation, a load-aware scheduling strategy is introduced. Before preparing to execute the cache generation task described in S520, the current load state of the server is first obtained, which is evaluated by the central processing unit (CPU) utilization, memory occupancy, input / output (I / O) throughput and other indicators. Specifically, only when it is determined that the current load state is in a low load interval, the cache generation process is started. Under this condition, the feature vectors and the inference results whose call frequencies are higher than a preset frequency are selected from the database, and are preferentially used to construct the core content of the first preset cache and the second preset cache. This approach focuses on the hotspot requests with the highest reuse value, improves the cache warm-up efficiency, realizes the peak-shaving utilization of computing resources, and avoids the burden in the peak period.
[0063] In some embodiments, for step S520, one possible implementation of the embodiment of the present application is provided, refer to Figure 6 , Figure 6 For Figure 4 The flowchart of substeps S522~S524 of step S520 in the embodiment, steps S522~S524 include: S522, in the case that the first preset cache and the second preset cache are both in an expired state, obtaining the inference result corresponding to the feature vector from the database; if the inference result corresponding to the feature vector is not obtained from the database, inputting the user audit request into the pre-trained large language model to obtain the inference result corresponding to the feature vector.
[0064] In this embodiment, when neither of the caches is available, the final data source guarantee mechanism is enabled. Thus, it is first detected that both the first preset cache and the second preset cache have exceeded their life cycles and are in an expired state, and cannot provide trusted services. In this case, the cache path is bypassed, and a query request is directly initiated to the database to attempt to obtain an inference result matching the current feature vector. If the corresponding record exists in the database, the result is returned; if not, it indicates that the user audit request is a new type never seen before, and the pre-trained large language model must be called to complete the first inference. The last degradation path constituted by this branch logic ensures that the basic service capability is still available in extreme cases.
[0065] S523, in the case where the first preset cache is in an expired state and the second preset cache is not in an expired state, finding the semantic partition corresponding to the feature vector in the second preset cache.
[0066] In this embodiment, when the first preset cache (local cache) is invalid but the second preset cache (distributed cache) is still valid, part of the service capability is retained. Thus, although the query of the first preset cache is abandoned, the data validity of the second preset cache is still trusted. Therefore, the semantic partition positioning process is continued, the semantic partition to which the current feature vector belongs is found in the second preset cache according to the content attribute of the feature vector, and the historical cache vector in the semantic partition is searched as the semantic partition corresponding to the feature vector; then the similarity of each historical cache vector in the semantic partition corresponding to the feature vector with the feature vector is calculated, the historical cache vector with the highest similarity with the feature vector is taken as the historical cache vector corresponding to the feature vector, and the inference result corresponding to the historical cache vector is obtained. This mechanism makes full use of the distributed cache resources that have not expired, prolongs the service window of the cache link, embodies the independent design of the layered cache, and enhances the fault tolerance capability.
[0067] S524, in the case where the first preset cache is not in an expired state and the second preset cache is in an expired state, if the inference result corresponding to the feature vector is not found in the first preset cache, obtaining the inference result corresponding to the feature vector from the database; if the inference result corresponding to the feature vector is not obtained from the database, inputting the user audit request into the pre-trained large language model to obtain the inference result corresponding to the feature vector.
[0068] In this embodiment, when the distributed cache is invalid but the local cache is still available, the local path is preferentially attempted. Thus, it is first searched in the first preset cache whether there is a matching item. If there is a hit, the result is directly returned; if there is no hit, the second preset cache that has expired is no longer attempted to be accessed, and the database query is turned to. If the record exists in the database, the inference result is returned; if not, the large language model is triggered to perform inference, so as to avoid wasting computing resources on invalid cache structures, realize intelligent routing selection based on the cache state, and optimize the access efficiency.
[0069] In some embodiments, regarding the expired and unexpired states of the first preset cache and the second preset cache, the present invention provides a possible implementation method, see [link to relevant documentation]. Figure 7 , Figure 7 A flowchart of another multi-level cache access method provided in this embodiment of the invention includes steps S600~S700: S600. Searching for the existence of a reasoning result corresponding to a feature vector in the first preset cache includes: if the first preset cache is not expired, searching for the existence of a reasoning result corresponding to a feature vector in the first preset cache.
[0070] In this embodiment, a pre-checking mechanism is introduced to ensure the validity of cache queries. Before performing any lookup operation, it is first determined whether the overall state of the first preset cache is still within its validity period. Here, the expired state is defined as the cached content exceeding the preset time to live (TTL) or being marked as invalid by an external event. Only if it is confirmed that the first preset cache is not in an expired state will the subsequent key-value retrieval process be initiated; otherwise, this level is skipped directly, and the process proceeds to the next stage, preventing erroneous queries based on outdated metadata and improving the reliability of the judgment.
[0071] S700, Finding the semantic partition corresponding to the feature vector in the second preset cache includes: if the second preset cache is not expired, finding the semantic partition corresponding to the feature vector in the second preset cache.
[0072] In this embodiment, validity constraints are also imposed on access to the second preset cache. Before attempting to locate semantic partitions, the overall timeliness of the second preset cache is first verified. When it is detected that the cache has not expired, routing and retrieval can be performed based on its internally maintained semantic partition structure; if it has expired, it is regarded as having no valid data available, and no partition lookup operation is performed; this ensures that all cache access behaviors are based on trusted data, strengthens the granularity of data consistency control, and fundamentally eliminates the matching deviation problem caused by using expired index structures.
[0073] Exemplarily, in the automobile finance high-concurrency business scenario, the running efficiency of the cache depends not only on the hit rate and response speed, but also on the optimization of resource utilization under different load conditions. Therefore, an energy-aware scheduling mechanism is introduced to dynamically adjust the cache management and model inference strategy according to the current computing load of the server, so as to balance the performance, delay and energy consumption. Specifically, the key resource indicators such as CPU, GPU and request queue are continuously monitored to obtain the current load state of the server, and the corresponding scheduling behavior is triggered accordingly. When it is detected that the current load is in a low load state, such as at night or during business gaps, it is determined that there is sufficient idle computing capacity at this time, and the pre-warming loading process is started. In this mode, based on the historical access log, the frequently occurring loan review request types are identified, and the corresponding inference results are automatically generated by calling the large language model, and these hot data are written into the first preset cache and the second preset cache in advance to prepare for the arrival of the subsequent peak period. This process makes full use of the redundant computing power during the low load period, avoiding resource contention due to concentrated requests during the peak period.
[0074] Further, when entering a high load state, i.e., the CPU or GPU usage rate reaches a preset threshold (such as 80% or more), the scheduling module switches to the strategy of the foregoing steps S100-S500 to ensure the response timeliness of the overall service. In this stage, the access logic of the first preset cache and the second preset cache is adaptively adjusted, and the core is to combine the real-time state of each level of cache, i.e., whether it is in an expired or unexpired state, to determine the data acquisition path. In specific implementation, if the first preset cache is not in an expired state, it is preferred to search for a matching feature vector corresponding item in it; once hit, the result is returned immediately, and the subsequent link is not entered. However, if the first preset cache is in an expired state, the local query is skipped, and the state of the second preset cache is determined. When the second preset cache is still in an unexpired state, semantic partition positioning and historical cache vector retrieval are continued to be performed therein to attempt to reuse the result through approximate matching; otherwise, if the second preset cache is also expired, no cache path is relied on, and the latest data is directly obtained from the database. If there is no record in the database, the model inference process is triggered. It is worth noting that in the high load mode, the similarity threshold condition can be further relaxed to allow selecting a candidate result with a higher similarity but not meeting the standard in the second preset cache as a degraded output, thereby minimizing the model calling frequency.
[0075] Therefore, the above scheduling mechanism does not control the model calling frequency in isolation, but deeply integrates the validity states of the first preset cache and the second preset cache respectively, forming a multi-dimensional decision tree structure. It can be understood that by real-time sensing the combined state of whether the first preset cache is expired and whether the second preset cache is expired, the optimal data source path is dynamically selected: in the case of valid dual cache, the fast path is taken, in the case of partial failure, the degradation path is enabled, and in the case of all failure, the persistent layer or model calculation is returned. This state-aware elastic scheduling strategy not only avoids invalid refreshing or rebuilding cache when resources are scarce, but also ensures that the high-cost model is not blindly called when available cache exists, achieving the coordinated optimization of energy efficiency and service quality.
[0076] Based on the above method, the embodiment of the present application also provides a system corresponding to the above method, as shown in Figure 8 Figure 8 The functional module schematic diagram of the multi-level cache access system provided by the embodiment of the present application. It should be noted that the multi-level cache access system 1000 provided by the present embodiment has the same basic principles and technical effects as the above method embodiment. For brief description, the part not mentioned in the present embodiment can refer to the corresponding content in the method embodiment.
[0077] In the present embodiment, the multi-level cache access system 1000 includes an acquisition module 1100, a first cache module 1200 and a second cache module 1300. The acquisition module 1100 is used to acquire the key field in the user audit request, and convert the key field into a feature vector. It can be understood that the acquisition module 1100 is used to execute the above step S100.
[0078] The first cache module 1200 is used to find whether the inference result corresponding to the feature vector exists in the first preset cache; the first preset cache records the correspondence between the feature vector and the inference result; in the case that the inference result corresponding to the feature vector exists in the first preset cache, the inference result corresponding to the feature vector is returned to the user. It can be understood that the first cache module 1200 is used to execute the above steps S200-S300.
[0079] The second cache module 1300 is configured to, in a case where the inference result corresponding to the feature vector does not exist in the first preset cache, find the semantic partition corresponding to the feature vector in a second preset cache, and determine a historical cache vector corresponding to the feature vector from the semantic partition, and an inference result corresponding to the historical cache vector; the second preset cache records a plurality of semantic partitions and a corresponding relationship between historical cache vectors and inference results under each semantic partition; and the inference result corresponding to the feature vector is determined according to the feature vector, the historical cache vector and the inference result corresponding to the historical cache vector. It can be understood that the second cache module 1300 is configured to perform steps S400-S500 described above.
[0080] In some embodiments, the second cache module 1300 is configured to calculate a similarity between the feature vector and a center vector of each semantic partition in the second preset cache; the center vector is a weighted average of all vectors in the semantic partition; the semantic partition corresponding to the center vector with the highest similarity to the feature vector is taken as the semantic partition corresponding to the feature vector; a similarity between each historical cache vector in the semantic partition corresponding to the feature vector and the feature vector is calculated; the historical cache vector with the highest similarity to the feature vector is taken as the historical cache vector corresponding to the feature vector, and an inference result corresponding to the historical cache vector is obtained. It can be understood that the second cache module 1300 is configured to perform steps S401-S404 described above.
[0081] In some embodiments, the second cache module 1300 is configured to, in a case where the similarity between the feature vector and the historical cache vector is greater than or equal to a set threshold, return the inference result corresponding to the historical cache vector to the user as a target cache result; and in a case where the similarity between the feature vector and the historical cache vector is less than the set threshold, input the user audit request into a pre-trained large language model to obtain the inference result corresponding to the feature vector. It can be understood that the second cache module 1300 is configured to perform steps S501-S502 described above.
[0082] In some embodiments, the multi-level cache access system 1000 further includes a synchronization module 1400. After the inference result corresponding to the feature vector is determined, the synchronization module 1400 is configured to store the feature vector and the inference result corresponding to the feature vector into a database; and every preset time length, the first preset cache and the second preset cache are generated according to the feature vectors and inference results currently stored in the database. It can be understood that the synchronization module 1400 is configured to perform steps S510-S520 described above.
[0083] In some embodiments, the synchronization module 1400 is configured to generate the first preset cache and the second preset cache according to the feature vector and the inference result in the database in the case that the current load state of the server is low load and the calling frequency of the feature vector is higher than the preset frequency. It can be understood that the synchronization module 1400 is configured to perform the above step S521.
[0084] In some embodiments, the synchronization module 1400 is configured to obtain the inference result corresponding to the feature vector from the database in the case that the first preset cache and the second preset cache are both in the expired state; input the user audit request into the pre-trained large language model to obtain the inference result corresponding to the feature vector in the case that the database does not obtain the inference result corresponding to the feature vector; find the semantic partition corresponding to the feature vector in the second preset cache in the case that the first preset cache is in the expired state and the second preset cache is not in the expired state; obtain the inference result corresponding to the feature vector from the database in the case that the first preset cache is not in the expired state and the second preset cache is in the expired state and the inference result corresponding to the feature vector is not found in the first preset cache; input the user audit request into the pre-trained large language model to obtain the inference result corresponding to the feature vector in the case that the database does not obtain the inference result corresponding to the feature vector. It can be understood that the synchronization module 1400 is configured to perform the above steps S522-S524.
[0085] In some embodiments, the synchronization module 1400 is configured to find whether the inference result corresponding to the feature vector exists in the first preset cache in the case that the first preset cache is not in the expired state; and find the semantic partition corresponding to the feature vector in the second preset cache in the case that the second preset cache is not in the expired state. It can be understood that the synchronization module 1400 is configured to perform the above steps S600-S700.
[0086] Based on the same inventive concept disclosed above, the embodiments of the present application also provide a block schematic diagram of an electronic device 2000 for performing the above method. Please refer to Figure 9 , Figure 9 The block schematic diagram of the electronic device provided by the embodiments of the present application, the electronic device 2000 comprises a processor 2100, a memory 2200, a bus 2300, and a communication interface 2400. The processor 2100 and the memory 2200 are connected through the bus 2300, and the processor 2100 communicates with external devices through the communication interface 2400.
[0087] The processor 2100 can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 2100 or the instruction in the form of software. The processor 2100 described above can be a general processor 2100, including a central processing unit 2100 (CPU), a network processor 2100 (NP), etc.; can also be a digital signal processor 2100 (DSP), an application specific integrated circuit (ASIC), a ready programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0088] The memory 2200 is used to store a computer program, for example, the multi-level cache access system 1000 in the embodiment of the application, including at least one software function module stored in the memory 2200 in the form of software or firmware, and the processor 2100 executes the program to realize the multi-level cache access method in the embodiment of the application after receiving an execution instruction.
[0089] The memory 2200 can include a high-speed random access memory 2200 (RAM) and can also include a non-volatile memory 2200. Optionally, the memory 2200 can be a storage device built in the processor 2100, or can be a storage device independent of the processor 2100.
[0090] The bus 2300 can be an ISA bus 2300, a PCI bus 2300 or an EISA bus 2300, etc. Figure 9 Only one bidirectional arrow is used, but it does not mean that there is only one bus 2300 or only one type of bus 2300.
[0091] The electronic device 2000 can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.
[0092] Based on the same inventive concept, the embodiment of the application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor 2100 to realize the multi-level cache access method as described above. The computer readable storage medium can include a U disk, a mobile hard disk, a read-only memory 2200 (ROM), a random access memory 2200 (RAM), a magnetic disk or an optical disk, etc. Various media that can store program codes.
[0093] The above merely provides the preferred embodiments of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles and technical scope of the present application shall fall into the scope of the present application.
Claims
1. A multi-level cache access method, characterized in that, The method includes: Obtain key fields from the user's review request and convert the key fields into feature vectors; The system checks if a reasoning result corresponding to the feature vector exists in the first preset cache; the first preset cache records the correspondence between feature vectors and reasoning results. If the inference result corresponding to the feature vector exists in the first preset cache, the inference result corresponding to the feature vector will be returned to the user. If the inference result corresponding to the feature vector does not exist in the first preset cache, the semantic partition corresponding to the feature vector is found in the second preset cache, and the historical cache vector corresponding to the feature vector and the inference result corresponding to the historical cache vector are determined from the semantic partition; the second preset cache records multiple semantic partitions and the correspondence between the historical cache vector and the inference result under each semantic partition; Based on the feature vector, the historical cache vector, and the inference result corresponding to the historical cache vector, the inference result corresponding to the feature vector is determined.
2. The method according to claim 1, characterized in that, The step of finding the corresponding semantic partition of the feature vector in the second preset cache, determining the historical cache vector corresponding to the feature vector from the semantic partition, and the inference result corresponding to the historical cache vector includes: Calculate the similarity between the feature vector and the center vector of each semantic partition in the second preset cache; the center vector is the weighted average of all vectors in the semantic partition; The semantic partition corresponding to the center vector with the highest similarity to the feature vector is taken as the semantic partition corresponding to the feature vector. Calculate the similarity between the historical cache vectors in the semantic partition corresponding to the feature vector and the feature vector; The historical cache vector with the highest similarity to the feature vector is taken as the historical cache vector corresponding to the feature vector, and the inference result corresponding to the historical cache vector is obtained.
3. The method according to claim 1, characterized in that, The step of determining the target cache result corresponding to the user review request based on the feature vector, the historical cache vector, and the inference result corresponding to the historical cache vector includes: If the similarity between the feature vector and the historical cache vector is greater than or equal to a set threshold, the inference result corresponding to the historical cache vector will be returned to the user as the target cache result. If the similarity between the feature vector and the historical cache vector is less than a set threshold, the user review request is input into a pre-trained large language model to obtain the inference result corresponding to the feature vector.
4. The method according to claim 1, characterized in that, After determining the inference result corresponding to the feature vector, the method further includes: Store the feature vector and the inference result corresponding to the feature vector into the database; Every preset time interval, the first preset cache and the second preset cache are generated based on the feature vectors currently stored in the database and the inference results.
5. The method according to claim 4, characterized in that, The database is configured on a server, and the step of generating the first preset cache and the second preset cache based on the feature vectors currently stored in the database and the inference results includes: When the server is currently under low load, the first preset cache and the second preset cache are generated based on the feature vectors in the database that are called more frequently than a preset frequency and the inference results.
6. The method according to claim 4, characterized in that, The method further includes: If both the first preset cache and the second preset cache are expired, the inference result corresponding to the feature vector is obtained from the database; if the inference result corresponding to the feature vector is not obtained from the database, the user review request is input into the pre-trained large language model to obtain the inference result corresponding to the feature vector. If the first preset cache is expired and the second preset cache is not expired, find the semantic partition corresponding to the feature vector in the second preset cache; If the first preset cache is not expired and the second preset cache is expired, and if the inference result corresponding to the feature vector is not found in the first preset cache, then the inference result corresponding to the feature vector is obtained from the database; if the inference result corresponding to the feature vector is not obtained from the database, then the user review request is input into the pre-trained large language model to obtain the inference result corresponding to the feature vector.
7. The method according to any one of claims 1-6, characterized in that, The step of checking whether the inference result corresponding to the feature vector exists in the first preset cache includes: If the first preset cache is not expired, check if the inference result corresponding to the feature vector exists in the first preset cache; Finding the semantic partition corresponding to the feature vector in the second preset cache includes: If the second preset cache is not expired, the semantic partition corresponding to the feature vector is found in the second preset cache.
8. A multi-level cache access system, characterized in that, The system includes: The acquisition module is used to acquire key fields from user review requests and convert the key fields into feature vectors; The first caching module is used to check whether the inference result corresponding to the feature vector exists in the first preset cache; the first preset cache records the correspondence between feature vectors and inference results; if the inference result corresponding to the feature vector exists in the first preset cache, the inference result corresponding to the feature vector is returned to the user. The second caching module is used to find the semantic partition corresponding to the feature vector in the second preset cache when the inference result corresponding to the feature vector does not exist in the first preset cache, and to determine the historical cache vector corresponding to the feature vector and the inference result corresponding to the historical cache vector from the semantic partition; the second preset cache records multiple semantic partitions and the correspondence between the historical cache vector and the inference result under each semantic partition; the inference result corresponding to the feature vector is determined according to the feature vector, the historical cache vector and the inference result corresponding to the historical cache vector.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program executable by the processor, the processor being able to execute the computer program to implement the multi-level cache access method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-level cache access method as described in any one of claims 1-7.
Citation Information
Patent Citations
Model reasoning method and device and electronic equipment
CN119129746A
Large model question answering method and device based on cache mechanism, storage medium and equipment
CN119621918A
Large model retrieval processing method and device
CN119988594A
Fusion caching method, system and equipment based on LLM cue word and medium
CN120277069A
Cache cleaning method and device based on large model reasoning
CN120540583A
Cited By
Content inference system and electronic device
CN122264133A