A large model memory management method, device and medium

By employing a multi-level memory partitioning management method consisting of active, stable, and cold storage areas, combined with modal feature extraction and fusion, the problem of knowledge redundancy and conflict in large-scale model deployments at the enterprise level is solved, achieving efficient and flexible knowledge management and retrieval.

CN121050663BActive Publication Date: 2026-01-27BEIJING DIGITAL CHINA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511595658.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-01-27
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

Existing large models face problems such as catastrophic forgetting, knowledge redundancy and conflict in enterprise-level deployments, making it difficult to achieve efficient and flexible knowledge injection and management, which affects the reliability and speed of inference.

Method used

A multi-level memory partitioning management method with active, stable, and cold storage areas is adopted. By calculating the similarity and conflict between new knowledge units and existing knowledge units, differentiated storage and processing are performed. Combined with modal feature extraction and fusion, the accuracy and reliability of knowledge management are achieved.

Benefits of technology

It improves the retrieval efficiency of large models, prevents catastrophic forgetting, reduces redundant knowledge, ensures the accuracy and reliability of knowledge, and meets the needs of enterprise-level knowledge injection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121050663B_ABST
    Figure CN121050663B_ABST
Patent Text Reader

Abstract

The application discloses a large model memory management method and device and medium, and relates to the technical field of artificial intelligence, and the method comprises the following steps: acquiring a new knowledge unit and a partition parameter corresponding to the new knowledge unit; confirming a storage partition corresponding to the new knowledge unit in a knowledge base according to the partition parameter; calculating the similarity between the new knowledge unit and each existing knowledge unit, and taking the existing knowledge unit with a similarity greater than a preset similarity threshold as a candidate conflict object; calculating the conflict degree of each candidate conflict object and the new knowledge unit, and processing the new knowledge unit according to the conflict degree to obtain a first processing result; and injecting the first processing result into the corresponding storage partition. The management method can effectively prevent and control catastrophic forgetting, guarantee the long-term retention and safety compliance of key knowledge, and provide technical support for the application of the large model in complex and continuously evolving scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to the field of artificial intelligence technology, and specifically to a method, device and medium for managing large model memory. Background Technology

[0002] Currently, most mainstream large-scale models adopt a hybrid memory architecture of in-parameter implicit memory and limited context window. In-parameter implicit memory relies on a large-scale pre-training process to encode massive amounts of general knowledge into the model parameter matrix, forming the basis for the model's understanding and generation capabilities; while the limited context window serves as a temporary workbench for real-time interaction, capable of holding only short-term information of hundreds to tens of thousands of tokens, used to handle immediate needs such as current dialogue and task instructions.

[0003] The aforementioned architecture demonstrates certain advantages in balancing model performance and inference efficiency. However, when faced with core requirements in enterprise-level deployments such as "continuously injecting new knowledge, adapting to dynamic scenario evolution, and achieving long-term personalized services," traditional memory architectures struggle to process knowledge injection in batches and flexibly. This easily leads to large models storing a large amount of repetitive, invalid, or irrelevant information, resulting in a series of deep-seated technical challenges such as catastrophic forgetting, knowledge redundancy, and conflicts. These challenges severely restrict the performance of large models in terms of inference reliability and speed. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, device and medium for large model memory management.

[0005] In a first aspect, the present invention provides a method for managing the memory of large models, including:

[0006] Obtain the new knowledge unit and the partition parameters corresponding to the new knowledge unit;

[0007] Based on the partitioning parameters, the storage partition corresponding to the new knowledge unit in the knowledge base is determined. The storage partition includes at least: an active area, a stable area, and a cold storage area.

[0008] Calculate the similarity between the new knowledge unit and each existing knowledge unit, and select existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects;

[0009] Calculate the conflict degree between each of the candidate conflict objects and the new knowledge unit, and process the new knowledge unit according to the conflict degree between each of the candidate conflict objects and the new knowledge unit to obtain a first processing result;

[0010] The first processing result is injected into the corresponding storage partition.

[0011] According to the technical solution provided by the present invention, acquiring new knowledge units includes: receiving a request to inject new knowledge and acquiring modal data carried by the new knowledge;

[0012] The new knowledge unit is obtained by processing the modal data.

[0013] According to the technical solution provided by the present invention, the partitioning parameters include at least: the importance and predicted usage probability of the new knowledge unit, and determining the storage partition of the new knowledge unit based on the partitioning parameters includes:

[0014] Based on the importance and predicted usage probability of the new knowledge unit, the matching score between the current new knowledge unit and the active area, stable area and cold storage area is calculated, and the partition with the highest matching score is taken as the storage partition.

[0015] According to the technical solution provided by the present invention, the new knowledge unit is processed based on the degree of conflict between each of the candidate conflict objects and the new knowledge unit, including:

[0016] Candidate conflict objects with a conflict degree greater than a preset conflict degree threshold are selected as target conflict objects.

[0017] Determine whether the target conflict object and the new knowledge unit are complementary;

[0018] If the target conflict object and the new knowledge unit are complementary, then the target conflict object and the new knowledge unit will be fused together.

[0019] If the target conflict object and the new knowledge unit are not complementary, then the importance and timeliness of the target conflict object and the importance and timeliness of the new knowledge unit are obtained, and the new knowledge unit is replaced based on the comparison of the importance and timeliness of the target conflict object and the new knowledge unit.

[0020] According to the technical solution provided by the present invention, the method further includes:

[0021] Obtain the historical activation parameters and inaccessible duration of existing knowledge units within the current knowledge base;

[0022] Based on the historical activation parameters, the activation score of each existing knowledge unit is calculated; the historical activation parameters include at least: the number of activations within a preset period, importance, and access inverse function;

[0023] If the activation score of the existing knowledge unit is greater than the preset promotion threshold, then the existing knowledge unit is migrated to the stable region.

[0024] If the activation score of the existing knowledge unit is less than the preset downgrade threshold, and the unaccessed duration is greater than the preset cold storage elimination period, then the existing knowledge unit is migrated to the cold storage area.

[0025] According to the technical solution provided by the present invention, the method further includes:

[0026] Obtain the duration during which the knowledge units in the cold storage area have not been accessed;

[0027] The knowledge units whose unaccessed duration exceeds the preset cold storage and elimination period are marked as knowledge units that can be eliminated.

[0028] Monitor the current capacity and access pressure of the knowledge base. When at least one of the capacity and access pressure exceeds the corresponding set threshold, delete the obsolete knowledge unit.

[0029] According to the technical solution provided by the present invention, the method further includes:

[0030] Monitor the risk status of the system and trigger a corresponding rollback request when the risk status is abnormal;

[0031] Based on the rollback request, the system's historical data is restored.

[0032] According to the technical solution provided by the present invention, the method further includes:

[0033] Obtain the knowledge content of the new knowledge unit;

[0034] Based on the knowledge content, determine whether the new knowledge unit contains data entries that need to be protected;

[0035] If the new knowledge unit contains data entries that need to be protected, then the data associated with those data entries will be erased.

[0036] In a second aspect, the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.

[0037] Thirdly, the present invention provides a computer-readable storage medium having a computer program that, when executed by a processor, implements the steps of the above-described method.

[0038] In summary, this technical solution specifically discloses a large model memory management method, device, and medium. The method includes: acquiring a new knowledge unit and corresponding partition parameters; identifying the storage partition corresponding to the new knowledge unit within the knowledge base based on the partition parameters, wherein the storage partition includes at least an active area, a stable area, and a cold storage area; calculating the similarity between the new knowledge unit and each existing knowledge unit, and designating existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects; calculating the conflict degree between each candidate conflict object and the new knowledge unit, and processing the new knowledge unit based on the conflict degree between each candidate conflict object and the new knowledge unit to obtain a first processing result; and injecting the first processing result into the corresponding storage partition.

[0039] Existing large-scale model memory architectures often encounter a series of deep-seated technical challenges when facing the needs of enterprise-level knowledge injection deployment, such as catastrophic forgetting, knowledge redundancy, and conflicts. This invention manages knowledge units through multi-level memory partitioning based on parameters such as the importance and probability of use of newly injected knowledge, thereby significantly improving retrieval efficiency and effectively preventing catastrophic forgetting. At the same time, it performs conflict detection by calculating the similarity and conflict degree of new knowledge units, effectively ensuring the accuracy and reliability of knowledge, while also avoiding excessive redundant knowledge entries. Attached Figure Description

[0040] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0041] Figure 1 This is a flowchart illustrating a large-scale model memory management method.

[0042] Figure 2 This is an expanded flowchart of step S104 of a large model memory management method.

[0043] Figure 3 This is a schematic diagram of a large-scale model memory management system.

[0044] Figure 4 This is a schematic diagram of a terminal device.

[0045] The diagram is labeled as follows: 500, Terminal Device; 501, CPU; 502, ROM; 503, RAM; 504, Bus; 505, I / O Interface; 506, Input Section; 507, Output Section; 508, Storage Section; 509, Communication Section; 510, Driver; 511, Removable Media; 601, Dynamic Partition Memory Pool Module; 602, Knowledge Conflict Detection and Fusion Module; 603, Version Snapshot and Rollback Module; 604, Injection-Elimination Adaptive Strategy Control Module; 605, Compliance and Security Management Module; 606, Multimodal Knowledge Compatibility and Unified Management Module. Detailed Implementation

[0046] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0047] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0048] Example 1

[0049] To make the technical solutions of the embodiments of the present invention clearer and easier to understand, the application background provided by the embodiments of the present invention is introduced below.

[0050] As the underlying framework for "knowledge storage and retrieval" in large models, the memory architecture directly determines the model's knowledge capacity, update efficiency, inference reliability, and scenario adaptability. Currently, mainstream large models generally adopt a hybrid memory architecture that combines implicit memory within parameters and a limited context window. This architecture is the core design for balancing the model's basic capabilities with real-time interaction efficiency, and its internal logic and operating mechanism profoundly affect the application boundaries of the model.

[0051] Among them, implicit memory within parameters relies on a large-scale pre-training process to encode massive amounts of general knowledge into the model parameter matrix, forming the basis for the model's understanding and generation capabilities;

[0052] The limited context window serves as a temporary workbench for real-time interaction, capable of holding only short-term information of hundreds to tens of thousands of tokens, used to handle immediate needs such as current dialogue and task instructions.

[0053] When large-scale applications with the aforementioned memory architecture move from general-purpose scenarios to enterprise-level deployments, and face core requirements such as continuously injecting new knowledge, adapting to dynamic scenario evolution, and achieving long-term personalized services, the implicit memory of parameters in this architecture only solidifies static knowledge. The capacity bottleneck of the context window becomes particularly prominent, leading to the gradual exposure of deep-seated technical shortcomings. Specifically, the main challenges are as follows:

[0054] (1) Limited knowledge increment injection: There is a lack of efficient, real-time and structured external knowledge increment writing mechanism, which makes it impossible to realize dynamic updates of business / user / environment knowledge.

[0055] (2) The problem of catastrophic forgetting is prominent: when injecting new knowledge, fine-tuning new tasks, or dealing with distribution drift, the original knowledge is easily overwritten or lost, resulting in a serious performance degradation.

[0056] (3) Knowledge redundancy and conflict are difficult to control: a large amount of low-value or highly redundant information accumulates, key knowledge is easily forgotten or conflicted, and there is a lack of controllability and traceability.

[0057] (4) Compliance and privacy are difficult to guarantee: It is impossible to achieve targeted erasure, version tracing and compliance proof for sensitive knowledge, and it is difficult to adapt to laws and regulations such as GDPR.

[0058] (5) Lack of behavioral feedback and intelligent decision-making mechanism: The existing elimination / forgetting strategy is disconnected from the actual reasoning behavior of the model, and cannot retain useful knowledge for a long time while dynamically eliminating invalid knowledge.

[0059] Based on the challenges faced by large models, there is an urgent need for a large model memory management method that can improve the continuous learning ability, knowledge base stability, security compliance, and adaptability to complex business scenarios of large model systems. This would enable large models to have higher intelligent service response efficiency and service accuracy when applied to scenarios such as intelligent dialogue, enterprise knowledge management, intelligent decision-making, and multimodal information processing, effectively promoting the use of artificial intelligence technology in various industry scenarios.

[0060] In view of this, the present invention proposes a large model memory management method, comprising: obtaining a new knowledge unit and partition parameters corresponding to the new knowledge unit; determining the storage partition corresponding to the new knowledge unit in the knowledge base according to the partition parameters, wherein the storage partition includes at least: an active area, a stable area, and a cold storage area; calculating the similarity between the new knowledge unit and each existing knowledge unit, and taking existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects; calculating the conflict degree between each candidate conflict object and the new knowledge unit, and processing the new knowledge unit according to the conflict degree between each candidate conflict object and the new knowledge unit to obtain a first processing result; and injecting the first processing result into the corresponding storage partition. It can be seen that the present invention, by obtaining the partition parameters corresponding to the newly injected knowledge unit, injects the new knowledge unit into the corresponding storage partition, and the partitioned storage method can significantly improve the retrieval efficiency of the large model in the later stages; by calculating the similarity and conflict degree of the new knowledge unit for conflict detection, and performing specific processing before injecting the new knowledge unit into the partition, it can not only ensure the accuracy and reliability of the knowledge, but also avoid excessive redundant knowledge entries.

[0061] To make the technical solution of the present invention clearer and easier to understand, the large model memory management method provided by the embodiments of the present invention will be described below with reference to the accompanying drawings. Figure 1 , Figure 2 As shown, this figure is a flowchart of a large model memory management method provided in an embodiment of the present invention. The executing entity of this method can be a large model memory management system, and the method includes:

[0062] S101, The management system obtains new knowledge units and the partition parameters corresponding to the new knowledge units;

[0063] The management system responds to knowledge injection requests by receiving new knowledge units in batches or individually. A new knowledge unit is the smallest knowledge carrier added to the model knowledge base through an incremental injection mechanism. When requesting injection, this new knowledge unit contains metadata such as content, tags, importance, and predicted usage, and is typically designed as "content +..." meta + embedding The three-element structure of “”.

[0064] Content refers to the substantive information carried by knowledge units, which is the basic material for models to understand, reason, and generate. Depending on the application scenario, content can be presented in various forms, such as text (e.g., product parameters or process steps), multimodal data (e.g., images, audio, and video that accompany the text, which need to form a semantic relationship with the text content), or structured data (e.g., tables or formulas).

[0065] meta This refers to structured tag information used to describe the attributes of a knowledge unit itself, such as knowledge ID, injection timestamp, source, domain, type, timeliness attribute, importance attribute, or sensitivity attribute. This structured tag information can be used as partitioning data, that is, as partitioning parameters.

[0066] embedding It refers to the semantic vector obtained by transforming knowledge content through encoders (such as BERT, CLIP, etc.), which serves as the core carrier for realizing knowledge semantic retrieval and association calculation.

[0067] The management system acquires new knowledge units by: receiving a request to inject new knowledge and obtaining the modal data carried by the new knowledge; processing the new knowledge based on the modal data to obtain new knowledge units; since new knowledge units can be single-modal data or multi-modal data (such as { text, image, audio, video, meta When dealing with single-modal data, newly received knowledge can be directly treated as a new knowledge unit; however, when dealing with multimodal data, feature fusion processing is required to obtain the final fused knowledge. embedding As a carrier of new knowledge units.

[0068] Specifically, the fusion of multimodal new knowledge requires the use of modal feature extraction models, such as BERT / LLM (text), CLIP (image), wav2vec (audio), I3D (video), etc., to extract fusion features. Each modal data is then subjected to feature extraction and standardized encoding separately so that the large model can process them in the same vector space. An example of modal feature extraction and encoding is shown below:

[0069] Text feature vectors:

[0070] Image feature vector:

[0071] Audio feature vector:

[0072] Video feature vector:

[0073] It should be noted that during the modal feature extraction and encoding process, if a knowledge unit is missing a certain modality, the component can be empty or filled with a zero vector / placeholder.

[0074] Next, the features from each modality are normalized to a unified semantic space using methods such as weighting, concatenation, alignment, or deep fusion models to obtain the final fusion. embedding , denoted as the fusion vector .

[0075] .

[0076] The above fusion vector is obtained The fusion method can be linear weighting, attention mechanism, MLP or Transformer, etc. (selected according to actual business needs), so that the fusion vector can be used for subsequent calculations. The system uses metadata such as attributes, tags, and predicted activity levels to confirm storage partitions. Simultaneously, the fusion vector generated for each knowledge unit can be used for indexing, retrieval, and partition management. Represented as a multimodal fusion function, for example, through an attention mechanism, Transformer Multimodal data can be fused using methods such as bilinear fusion.

[0077] S102. The management system determines the storage partition corresponding to the new knowledge unit in the knowledge base based on the partition parameters. The storage partition includes at least: active area, stable area and cold storage area.

[0078] The partitioning parameters are used to characterize the attributes of the new knowledge unit itself, and can reflect the core partitioning information such as the importance of the new knowledge unit and the predicted probability of its use.

[0079] The management system's knowledge base is used to store all knowledge units.

[0080] The knowledge base's storage partitions can be divided into active, stable, and cold storage areas to achieve differentiated storage, dynamic flow, and efficient resource utilization of knowledge. This allows knowledge of different values ​​and activity levels to be matched with the most suitable storage strategies and access priorities. As the names suggest, the active area is the core area for high-frequency knowledge interaction, storing knowledge units closely related to the current task and accessed with extremely high frequency. Priority is given to ensuring low-latency, high-bandwidth access to this knowledge to support the real-time inference needs of large models. The stable area is the area for preserving the long-term value of knowledge, storing knowledge units that are of high importance and need to be retained for a long time but whose access frequency is lower than that of the active area, balancing storage costs and knowledge value preservation. The cold storage area is the area for low-frequency backup and archiving of knowledge, storing knowledge units with extremely low access frequency but still with retention value (such as those that need to be retained for compliance or may be reused in the future), with low cost and large capacity as the core objectives.

[0081] The specific process for determining the storage partition corresponding to the new knowledge unit based on the partition parameters is as follows: Based on the partition parameters, calculate the current new knowledge unit and the active area. active Stable zone stabl e and cold storage area cold The partition with the highest matching score is selected as the storage partition; the partition parameters include at least: the importance of the new knowledge unit and the predicted probability of use.

[0082] Specifically, for each new knowledge unit to be injected The storage partition to which it belongs can be calculated based on the following formula (1):

[0083] Formula (1);

[0084] in, Represented as a new knowledge unit The corresponding partitioning results; This represents the new knowledge unit given by humans or systems. The importance of hitting (e.g., high / medium / low, quantifiable numerically allowed); This represents the storage partition that corresponds to the maximum matching score output by the objective function, i.e., selecting the storage partition with the highest matching score; Represented as a new knowledge unit predicted by the model Predicted usage probability in the near future Represented as a new knowledge unit With storage partition p Tag matching score; Represented as business line weight / scenario priority; It is represented as a dynamically adjustable weight parameter.

[0085] Here for An example is given to illustrate the adaptive dynamic adjustment strategy:

[0086] a weight vector with fixed initial values Initially, summarize business and load signals periodically (e.g., every 10-30 minutes): including predicted heat deviation (hot / cold bias), capacity and access pressure, partition ratio drift, tag mismatch / cross-domain pollution, compliance rejection / rollback rate, etc.; map these signals into small-step adjustments. Direction and magnitude: Business peak increase Enhanced compliance sensitivity Capacity shortage reduced and appropriately increase After adjustment softmax Normalization (ensuring non-negativity and summation to 1), followed by upper and lower limit clipping and a "cooldown time" to prevent jitter, and lightweight calibration in conjunction with the threshold. ; here These are represented as activation time, hibernation time, and idle time, respectively, allowing for a more rational allocation of time for "working, hibernating, and waiting".

[0087] In another embodiment, if the new knowledge unit The fusion vector obtained by fusion For its partition assignment decision, it can be determined by the partition parameters (attributes, labels, and predicted activity) of the fusion vector, and then decide which active region to assign to. active Stable zone stabl e and cold storage area cold The partitioning result is calculated using the following formula (2):

[0088] Formula (2).

[0089] in, Represented as a new knowledge unit The partitioning results; It can be a rule-driven function or a model-driven function, depending on the complexity of the system, interpretability requirements, and engineering implementation costs.

[0090] Based on the above, it can be seen that the current management system differs from existing partitioning methods that only support single modalities and static rules. Instead, it supports unified partitioning and management of multimodal knowledge units such as text, images, audio, and video, breaking down the barriers between different modalities of data. This allows large models to understand and associate multi-source information in the same dimension, adapting to a wider range of application scenarios. At the same time, by combining partitioning parameters such as the importance of knowledge and the probability of predicted use, different new knowledge units are allocated to active, stable, or cold storage areas. This differentiated storage strategy effectively optimizes resource utilization and improves the efficiency of knowledge access, retrieval, and management.

[0091] S103. The management system calculates the similarity between the new knowledge unit and each existing knowledge unit, and identifies existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects.

[0092] Existing knowledge units refer to the knowledge units already stored in the knowledge base of the current management system.

[0093] It should be noted that the scope of the similarity calculation between the new knowledge unit and each existing knowledge unit can be between the new knowledge unit and each existing knowledge unit in its corresponding storage partition, or it can be between the new knowledge unit and all existing knowledge units in the knowledge base (hereinafter referred to as all existing knowledge units stored globally). There is no special limitation on the specific scope, which depends on the business requirements for the scope of conflict resolution.

[0094] The following method is used to calculate the similarity between the new knowledge unit and each existing knowledge unit:

[0095] Assume that all existing knowledge units stored in the storage partition / global space are denoted as... K i New knowledge unit With existing knowledge units K i The similarity can be calculated based on the following formula (3):

[0096] Formula (3);

[0097] in, Represented as a new knowledge unit With existing knowledge units Similarity; and Represented as a new knowledge unit With existing knowledge units semantic vector; Represented as cosine similarity, it is an index that measures the similarity between two semantic vectors.

[0098] like Then the existing knowledge units Listed as candidate conflict objects and included in the conflict degree calculation, if all existing knowledge units With new knowledge units The similarity between the new knowledge units is less than the preset similarity threshold. Then directly inject into the corresponding storage partition; This represents the preset similarity threshold, which can be selected between 0.3 and 0.9. The specific value will not be specified here.

[0099] S104. The management system calculates the degree of conflict between each candidate conflicting object and the new knowledge unit, and processes the new knowledge unit according to the degree of conflict between each candidate conflicting object and the new knowledge unit to obtain the first processing result.

[0100] Specifically, the process for calculating the conflict level is as follows:

[0101] Assume that existing knowledge units Those listed as candidate conflict targets are used to calculate the conflict degree using the following formula (4):

[0102] Formula (4);

[0103] in, Represented as existing knowledge units and new knowledge units The degree of conflict; It is represented as a conflict score based on entities, relations, and factual content (such as negation, mutual exclusion of facts, spatiotemporal contradictions, etc.). The score represents the contradictions in metadata such as business tags and attributes; It is represented as a weight parameter.

[0104] Based on the above, it can be seen that the embodiments of the present invention can quickly eliminate unrelated existing knowledge units by calculating similarity, focus on objects that may overlap or be related, reduce the amount of subsequent calculations, and thus record existing knowledge units with "similarity greater than a preset similarity threshold" as candidate conflict objects, and then further calculate the conflict degree.

[0105] In another embodiment, cross-modal retrieval and similarity detection further include the following process:

[0106] Input Search query (can be) text / image / audio / vide (any mode), via the corresponding encoder encoder Generate query embedding , recorded as ; Calculate the above formula (3) With all of the knowledge base The similarity is used to return the most relevant multimodal knowledge unit set in descending order of similarity, thereby realizing intra-modal / cross-modal retrieval. Since the calculation process and principle of similarity are the same as those mentioned above, they will not be elaborated on here. In addition, when cross-modal knowledge merging is performed on the fusion vector, the fusion expression will be automatically generated and the original entries will be archived. The management system automatically records snapshots and operation logs for all injection / change / retrieval / fusion / rollback operations, supporting subsequent retrospective and compliance audits.

[0107] It should be noted that, in the embodiments of the present invention, different modalities (such as text, images, and audio) under the same knowledge unit can independently calculate the subsequently proposed activation scores and sensitivity determinations, and be migrated, eliminated, or restored respectively. Furthermore, it supports modality-level selective operations during partition snapshots and rollbacks, effectively enhancing the flexibility and reliability of the system in complex real-world scenarios. This mechanism effectively solves the technical drawbacks of existing technologies, such as coarse granularity in multimodal knowledge processing and the inability to independently manage specific modalities.

[0108] Conflict level, as a quantitative indicator of content contradiction, duplication, and mutual exclusion, allows for corresponding processing of new knowledge units based on their numerical performance. This processing includes, for example, fusion and replacement, ensuring the accuracy and reliability of the new knowledge units. It also assists the system in dynamically compressing redundant information and automatically aggregating content related to the same theme. In practical applications, the compression rate of redundant knowledge items reaches over 70%, effectively optimizing the knowledge base structure and operational efficiency. Specifically, the process of processing new knowledge units is as follows:

[0109] S1041. The management system uses candidate conflict objects with a conflict degree greater than the preset conflict degree threshold as target conflict objects.

[0110] Connect each candidate conflict object with the new knowledge unit The degree of conflict is denoted as ,like If so, the candidate conflict object is identified as the "target conflict object," and the conflict processing branch is initiated; here, This represents the preset conflict threshold.

[0111] S1042. The management system determines whether the target conflict object and the new knowledge unit are complementary. If the target conflict object and the new knowledge unit are complementary, they are merged. If the target conflict object and the new knowledge unit are not complementary, the importance and timeliness of the target conflict object and the importance and timeliness of the new knowledge unit are obtained, and the new knowledge unit is replaced based on the comparison of the importance and timeliness of the target conflict object and the new knowledge unit.

[0112] Within the conflict resolution branch, priority is given to determining whether the target conflict object and the new knowledge unit are complementary and whether they can be merged; the fusion operation here can be directly executed using the following formula (5):

[0113] Formula (5);

[0114] in, This is represented as a knowledge unit resulting from the fusion of conflicting objects and new knowledge units. Indicated as the target conflict object; The table shows the fusion function.

[0115] Furthermore, for example, the fusion determination can be made through the following process:

[0116] (1-1) Gating for determining the same entity / same range

[0117] Perform entity / range alignment (same model / same version / same region / same time window). If the conditions are not met, do not perform the merging process (it may be different objects with the same name or cross-domain information).

[0118] (1-2) Conflict gating (must be almost zero)

[0119] Perform NLI / rule comparison on overlapping slots: If there is a hard conflict such as "battery = 4000mAh vs 5000mAh", proceed with conflict handling first and do not perform fusion processing.

[0120] (1-3) Complete the gain (needs to be large enough)

[0121] New knowledge units provide information in uncovered slots (attribute completion, source supplementation, evidence chain), or content can be connected with conflicting objects to form a longer coherent block (information splicing), or the summaries of the two can be synthesized to improve the coverage of key points (summary synthesis gain).

[0122] Ultimately, only when "gating passes + gain ≥ threshold" is the target conflict object and the new knowledge unit determined to be complementary, and the fusion process shown in formula (5) above can be performed to obtain the fused knowledge unit. Conversely, a replacement process is performed.

[0123] Furthermore, the replacement process is divided into: replacement according to priority strategy and replacement requiring manual confirmation; among them, priority strategy replacement is as follows: if the importance, timeliness, and other priorities of the new knowledge unit are higher than the target conflict object, the new knowledge unit directly replaces the target conflict object; if the priorities between the new knowledge unit and the target conflict object are difficult to determine automatically (such as both facts having authoritative sources), a detailed conflict report is generated and pushed to experts / operations and maintenance for intervention.

[0124] It should be noted that during the above execution process, the management system will record detailed logs of conflict detection and decision-making, including all calculated scores, threshold determinations, and operation records; if there is manual handling, the feedback will be recorded and the processing process will be automatically archived; if there is merging or replacement, the snapshot and version history will be updated to facilitate subsequent abnormal risk recovery.

[0125] S105. The management system injects the first processing result into the corresponding storage partition.

[0126] The first processing result here can be the fused knowledge unit. Alternatively, it can be a knowledge unit confirmed after replacement processing (a knowledge unit with better importance and timeliness). Specifically, if the new knowledge unit does not trigger the preset similarity threshold and preset conflict threshold, it is directly injected into the corresponding storage partition. If the new knowledge unit and the target conflict object have undergone fusion processing, the fused knowledge unit is injected into the corresponding storage partition as the first processing result, and the knowledge unit corresponding to the original conflict object is archived / deleted. In the replacement adjudication process, the new knowledge unit and the target conflict object are determined based on the final adjudication result to confirm whether the first processing result is a new knowledge unit or a target conflict object, and then knowledge injection is performed.

[0127] Furthermore, the management system needs to not only migrate existing knowledge units in a timely manner when new knowledge is injected, but also to perform batch migration management of knowledge units in the knowledge base on a regular basis. This migration can be understood as re-partitioning and deleting existing knowledge units based on their activity level over a period of time.

[0128] Based on this, in one embodiment, the method provided by the present invention further includes the following steps:

[0129] Step A1: The management system obtains the historical activation parameters and inaccessible duration of existing knowledge units in the current knowledge base;

[0130] Historical activation parameters are used to show the performance of knowledge units over a certain period of time.

[0131] Specifically, the historical activation parameters include at least the following:

[0132] Number of times a knowledge unit is activated within a certain period usage_freq ;

[0133] The importance of knowledge units marked by humans or business operations importance ;

[0134] The inverse function of the distance from the last access to the knowledge unit recent_access .

[0135] Unaccessed time refers to the time interval between the last access to an existing knowledge unit and the current time, which is detected by the management system and denoted as . .

[0136] Step A2: The management system calculates the activation score of each existing knowledge unit based on historical activation parameters; historical activation parameters include at least: the number of activations within a preset period, importance, and access inverse function;

[0137] The activation score of existing knowledge units is calculated using the following formula (6):

[0138] Formula (6);

[0139] in, Represented as the activation score of the knowledge unit; usage_freq(K) This represents the number of times a knowledge unit is activated within a certain period. A knowledge unit includes existing knowledge units. importance(K) The importance of knowledge units represented by manual or business tags; recent_access(K) It is represented as the inverse function of the distance from the last access to the knowledge unit; Represented as weighting coefficients, for example, taking Among them, knowledge units K Includes new knowledge units With existing knowledge units Knowledge Unit K It is a collective term for all knowledge units.

[0140] Step A3: If the activation score of an existing knowledge unit is greater than the preset promotion threshold, then the existing knowledge unit is migrated to the stable area; if the activation score of an existing knowledge unit is less than the preset downgrade threshold and the unaccessed time is greater than the preset cold storage elimination period, then the existing knowledge unit is migrated to the cold storage area.

[0141] Specifically, a preset promotion threshold is set as follows: The preset downgrade threshold is The preset cold storage elimination cycle is ;

[0142] If activation score Greater than the preset promotion threshold If the activation score is high, then the existing knowledge unit will be migrated to the stable region; if the activation score is low, then the existing knowledge unit will be migrated to the stable region. Less than the preset downgrade threshold And the duration of time not accessed Greater than the preset cold storage elimination period If so, the existing knowledge unit will be migrated to the cold storage area.

[0143] In addition, regarding the preset cold storage elimination cycle Preset downgrade threshold It is also necessary to make dynamic adjustments based on system operating indicators, specifically including the following strategies:

[0144] (2-1) ;

[0145] in, If If, then; This represents the current storage capacity; This is represented as the system's maximum capacity threshold. All of these are system adaptive adjustment step sizes;

[0146] Based on the above adjustment strategy, it can be seen that when the current storage capacity exceeds the system's maximum capacity threshold, a coefficient is used. Multiply by the preset cold storage elimination period and using coefficients Multiply by the preset downgrade threshold Adjusting the system's maximum capacity threshold and preset degradation threshold means that the preset cold storage phase-out period needs to be lowered at this time. Increase the preset downgrade threshold This makes it easier for existing knowledge units to be downgraded and accelerates the elimination of existing knowledge units.

[0147] (2-2) Increase the frequency of elimination and temporarily boost the weight of the partition;

[0148] in, This represents the system's access pressure; This is expressed as the system's maximum load threshold;

[0149] Based on the above adjustment strategies, it can be seen that when the system's access pressure exceeds the system's maximum load threshold, such as when the number of requests per unit time is too large and the system cannot handle it, the management system can make adaptive adjustments by increasing the elimination frequency and temporarily increasing the partition weight. For example, it can increase the triggering test for partition updates and knowledge unit elimination to increase the elimination frequency; or, it can adjust the partition weights of the three partitions according to the current capacity of the knowledge unit.

[0150] (2-3) Supports automatic adjustment of capacity ratio in multiple partitions. For example, the capacity of active, stable and cold partitions should be maintained at a certain ratio. When a deviation occurs, automatic inter-partition migration and elimination will be triggered.

[0151] As can be seen, the key strategy parameters such as migration, elimination, fusion, and snapshot of each partition in this embodiment of the invention support dynamic adaptive adjustment based on knowledge base load, business characteristics, and historical behavior. It supports both rule-driven and machine learning optimization paths, improving the system's self-evolution capability and business adaptability. Unlike the static partitioning of other solutions, this solution has real-time feedback and global optimization capabilities, enabling automatic selection and robust evolution of the knowledge base. This ensures convenient access to high-value and highly active knowledge while reasonably releasing storage resources occupied by long-term idle knowledge, thereby optimizing the knowledge storage structure and improving the overall efficiency of knowledge management and retrieval.

[0152] In one embodiment, knowledge units in the cold storage area are generally determined to be idle and useless. In order to release the capacity and access pressure of the knowledge base in a timely manner, in addition to updating the existing knowledge units by partition, the knowledge base also needs to periodically / triggerically eliminate existing knowledge units. Therefore, the method provided by the present invention further includes the following steps:

[0153] Step C1: The management system obtains the duration of unaccessed knowledge units in the cold storage area;

[0154] Step C2: The management system marks knowledge units that have not been accessed for a longer period than the preset cold storage and elimination period as knowledge units that can be eliminated.

[0155] Step C3: The management system monitors the knowledge base capacity and access pressure. When at least one of the capacity and access pressure exceeds the corresponding set threshold, the knowledge unit that can be eliminated will be deleted.

[0156] The management system monitors the duration of unaccessed knowledge units within the cold storage area. Meanwhile, the duration of any unaccessed knowledge unit is detected. Greater than the preset cold storage elimination period When the knowledge unit is marked as a removable knowledge unit, the management system will first mark it as such. When the capacity of the cold storage area or the access pressure of the knowledge base exceeds the corresponding set threshold, the management system will archive / delete all removable knowledge units in batches.

[0157] In one embodiment, the method provided by the present invention further includes the following during the knowledge management operation:

[0158] Step D1: The management system monitors the risk status of the system and triggers the corresponding rollback request when the risk status is abnormal;

[0159] When the management system detects an abnormal system status or amplified risk, it will trigger a rollback. The risk status here includes, but is not limited to, key indicators (accuracy / recall / consistency, latency / error rate) falling below the threshold or changing drastically after going live; for example, gray-scale / A / B group significantly worse than the baseline, consistency check failure (inconsistency between main memory and vector index / hash check, abnormal partition water level), abnormal peak of batch replacement / deletion, discovery of wrong deletion or modification, user / audit appeals, or compliance and security alerts (accidental exposure of sensitive data, tag downgrade), and disaster recovery events such as storage / index corruption, etc., which will not be elaborated on here.

[0160] Step D2: Restore the system's historical data according to the rollback request.

[0161] Every injection / removal action in the management system is automatically recorded in the audit log and snapshot system, including the operator, time, knowledge ID, operation type, and previous and subsequent partition status. This supports rollback operations that can be quickly rolled back to any historical state due to misoperation or policy error by using the snapshot ID, ensuring system robustness and traceability.

[0162] A snapshot ID is a unique anchor point pointing to a state at a specific point in time. It is a physical pointer / primary key directly located in the storage (corresponding to a snapshot list / incremental log set). When the management system records operations, it will synchronously generate a snapshot (i.e., a copy of the state of the knowledge storage system at a specific moment) and use the snapshot ID to uniquely identify the state. Then, after a rollback request is triggered, the knowledge base content or partition state can be restored based on the snapshot ID and scope corresponding to the rollback request.

[0163] In one embodiment, the method provided by the present invention further includes the following steps:

[0164] Step R1: The management system acquires the knowledge content of the new knowledge unit;

[0165] Step R2: The management system determines whether the new knowledge unit contains data entries that need to be protected based on the knowledge content; if the new knowledge unit contains data entries that need to be protected, the data associated with the data entries that need to be protected will be erased.

[0166] Based on data items that have been detected by NLP or manually marked by users as requiring protection, the management system will automatically trigger or allow users / administrators to initiate operations such as targeted erasure, periodic checks, and batch compliance cleanup of data items. At the same time, the system supports periodic sensitive knowledge scanning and automatic compliance cleanup, and regularly summarizes and generates batch compliance reports.

[0167] Specifically, the management system uses automatic NLP entity recognition and keyword detection (such as sensitive types like PII, finance, and medical), or allows users / administrators to manually mark items as sensitive / compliant:

[0168] Formula (7);

[0169] in, This indicates whether a knowledge unit is sensitive knowledge. This refers to using Natural Language Processing (NLP) technology to analyze the content of knowledge units in order to determine whether the content contains sensitive information (such as privacy, confidentiality, or prohibited speech). This means that if a knowledge unit satisfies either of these two conditions, it is determined to be sensitive knowledge. It is represented as "or".

[0170] After the above detection, the sensitive knowledge needs to be added to the erasure queue and an erasure process ID needs to be generated, thereby completely deleting the sensitive knowledge from the knowledge base. At the same time, the management system in this embodiment will also synchronously cascade and delete all historical snapshots and search indexes related to the sensitive knowledge. embedding Vectors, cross-modal mappings, partition references, and other related items must be ensured to have no residual copies. Furthermore, when erasing data associated with the protected data entry, the following rules must be observed:

[0171] (3-1) If the sensitive knowledge is multimodal knowledge, the management system will need to erase all physical and logical instances of it in different modal / storage layers.

[0172] (3-2) If the erase operation fails due to dependency conflicts, system errors, etc., the management system will automatically retry or report to manual intervention, generate a failure log and archive it.

[0173] (3-3) If a knowledge unit is locked by a business task, the management system can first suspend the relevant business or delay the erasure until it can be safely deleted.

[0174] After the operation is completed, the management system will automatically generate an operation report, which can be exported as PDF / structured JSON and archived to the compliance audit system. It is evident that this embodiment of the invention addresses the multimodal, multi-partition, and multi-layered storage issues of sensitive data by designing a chain-recursive erasure mechanism. This mechanism can automatically trace and completely delete all storage instances of knowledge units across various partitions, modalities, historical snapshots, and business interfaces, automatically generating a complete operation chain and compliance proof. It also supports one-click export of compliance reports. This method is significantly superior to existing solutions that only support shallow data cleaning or single-modal erasure.

[0175] Based on the above, this invention describes a large model memory management method. This method responds to knowledge injection requests, then obtains new knowledge units and corresponding partitioning parameters. It automatically manages partitioning based on parameters such as knowledge importance and predicted usage probability, thus obtaining the storage partition corresponding to the new knowledge unit. For the injection of new knowledge units, this method supports unified injection of multimodal knowledge, including text, images, audio, and video. Based on conflict detection and multimodal knowledge fusion, it can dynamically compress redundant information and automatically aggregate content related to the same topic, optimizing the knowledge base structure and operational efficiency. Furthermore, this method employs a multi-level partitioning and dynamic migration mechanism, combined with efficient snapshot rollback (the system automatically generates snapshots and audit logs for all knowledge operations, achieving 100% full-process recording while supporting audit report output), ensuring that key knowledge units are reliably retained for a long time during the continuous evolution of the knowledge base, the injection of new knowledge, or model updates. Finally, this method also employs periodic sensitive knowledge judgment, supports targeted erasure and end-to-end cascading cleanup, and can automatically generate structured compliance reports, thereby improving the security capabilities of enterprise-level applications.

[0176] Based on the above, it can be seen that the present invention has the following beneficial effects:

[0177] (a) Effectively reduce the risk of catastrophic forgetting and knowledge loss

[0178] This method employs a multi-level partitioning and dynamic migration mechanism, combined with efficient rollback via snapshot ID, to ensure that key knowledge units are reliably retained over the long term during the continuous evolution of the knowledge base, the injection of new knowledge, or model updates. In practical applications, the system's measured core knowledge retention rate can reach over 95%, and the accuracy of business data recovery after snapshot rollback can reach 99%.

[0179] (ii) Enhance the intelligent evolution and information compression capabilities of the knowledge base

[0180] This method, through automatic partitioning management, conflict detection, and multimodal knowledge fusion, enables the system to dynamically compress redundant information and automatically aggregate content related to the same topic. In practical applications, the compression rate of redundant knowledge items reaches over 70%, achieving the goal of optimizing the knowledge base structure and operational efficiency.

[0181] (III) Full-process controllability and traceability to enhance business security and compliance.

[0182] This method automatically generates snapshots and audit logs for all knowledge operations, achieving 100% end-to-end recording. Sensitive knowledge supports targeted erasure and end-to-end cascading cleanup, and can automatically generate structured compliance reports, effectively improving the security capabilities of enterprise applications.

[0183] (iv) Multimodal fusion, enabling complex business and multi-scenario reasoning

[0184] This method differs from existing partitioning methods that only support single modalities and static rules. It supports the unified injection, fusion, and retrieval of multimodal knowledge such as text, images, audio, and video, enabling cross-modal intelligent queries. The system achieves a cross-modal retrieval accuracy of over 90% and a multimodal knowledge fusion coverage of ≥50%, significantly enhancing the reasoning and business support capabilities of large models in multiple scenarios and with multiple data sources.

[0185] (v) Supporting the dynamic evolution and deployment of enterprise-level large-scale intelligent agents

[0186] This method supports flexible expansion and adaptation to multiple business scenarios. For large-scale knowledge bases (millions of entries), the latency for a single knowledge injection / elimination / fusion process is ≤50ms. The system's continuous operation stability reaches 99.99%. The cycle for new business knowledge access or policy changes is shortened to within 1 day, thereby improving the maintainability of the system engineering and the ability to be productized.

[0187] The above text combined Figure 1 , Figure 2 The large-scale memory management method for quantity injection and forgetting prevention provided in the embodiments of the present invention has been described in detail below. Figure 3 , Figure 4 The apparatus, equipment, and media provided in the embodiments of the present invention will be described.

[0188] Based on the aforementioned method for large-scale model memory management with quantity injection and forgetting prevention, this invention proposes a large-scale model memory management system with quantity injection and forgetting prevention, which includes:

[0189] The dynamic partition memory pool module 601 is used to obtain new knowledge units and partition parameters corresponding to the new knowledge units; and to determine the storage partitions in the knowledge base corresponding to the new knowledge units based on the partition parameters. The storage partitions include at least: active area, stable area and cold storage area.

[0190] Specifically, determining the storage partition corresponding to the new knowledge unit within the knowledge base based on the partitioning parameters includes: the partitioning parameters include at least the importance and predicted usage probability of the new knowledge unit; determining the storage partition of the new knowledge unit based on the partitioning parameters includes: calculating the matching score between the current new knowledge unit and the active area, stable area, and cold storage area based on the importance and predicted usage probability of the new knowledge unit, and taking the partition with the highest matching score as the storage partition.

[0191] In addition, the dynamic partition memory pool module 601 is also used to obtain the historical activation parameters and unaccessed duration of existing knowledge units in the current knowledge base; calculate the activation score of each existing knowledge unit based on the historical activation parameters; if the activation score of an existing knowledge unit is greater than the preset promotion threshold, then the existing knowledge unit is migrated to the stable area; if the activation score of an existing knowledge unit is less than the preset downgrade threshold and the unaccessed duration is greater than the preset cold storage elimination period, then the existing knowledge unit is migrated to the cold storage area.

[0192] The knowledge conflict detection and fusion module 602 is used to calculate the similarity between the new knowledge unit and each existing knowledge unit, and to take the existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects; calculate the conflict degree between each candidate conflict object and the new knowledge unit, and process the new knowledge unit according to the conflict degree between each candidate conflict object and the new knowledge unit to obtain the first processing result.

[0193] The process involves processing the new knowledge unit based on the degree of conflict between each candidate conflicting object and the new knowledge unit. This includes: designating candidate conflicting objects with a conflict degree greater than a preset conflict degree threshold as target conflicting objects; determining whether the target conflicting object and the new knowledge unit are complementary; if they are complementary, then merging them; if they are not complementary, then obtaining the importance and timeliness of the target conflicting object and the new knowledge unit, and replacing the new knowledge unit based on the comparison of their importance and timeliness.

[0194] Version snapshot and rollback module 603 is used to monitor the risk status of the system and trigger the corresponding rollback request when the risk status is abnormal; and restore the historical data of the system according to the rollback request.

[0195] The injection-elimination adaptive strategy control module 604 is used to obtain the unaccessed duration of knowledge units in the cold storage area; and to mark knowledge units whose unaccessed duration exceeds the preset cold storage elimination period as knowledge units that can be eliminated; and to monitor the capacity and access pressure of the current knowledge base, and to delete knowledge units that can be eliminated when at least one of the capacity and access pressure exceeds the corresponding set threshold.

[0196] The compliance and security management module 605 is used to acquire the knowledge content of the new knowledge unit; and, based on the knowledge content, to determine whether the new knowledge unit contains data entries that need to be protected. If the new knowledge unit contains data entries that need to be protected, the data associated with the data entries that need to be protected will be erased.

[0197] The multimodal knowledge compatibility and unified management module 606 is used to receive new knowledge injection information and modal data of the new knowledge injection information; and to process the new knowledge injection information according to the modal data to obtain new knowledge units.

[0198] As described above, the partitioning mechanism adopted by the management system in this embodiment of the invention is deeply integrated with the full lifecycle operations such as conflict detection, snapshots, elimination, compliance, and rollback. It can achieve system-level self-adjustment and collaborative response when knowledge structure changes, business pressure changes, and multimodal content changes simultaneously. This breaks through the limitations of partitioning management being isolated from other modules and having a single modality in existing technologies such as MemOS. At the same time, the core modules of this management system are highly decoupled and have standardized interfaces, supporting independent expansion and flexible combination. However, it can also achieve event cascading and global closed-loop collaboration at key lifecycle nodes (such as knowledge migration, integration, sensitive handling, rollback, etc.), forming dynamic response and audit backtracking capabilities, and empowering large-scale application deployment.

[0199] The management system according to embodiments of the present invention can correspond to the execution of the methods described in the embodiments of the present invention, and the above and other operations and / or functions of each module of the management system are respectively for implementing Figure 1 The corresponding process of the method in the illustrated embodiment will not be described in detail here for the sake of brevity.

[0200] The present invention also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of a large model memory management method as described in Embodiment 1.

[0201] In this embodiment, as Figure 4 As shown, the terminal device 500 includes a CPU 501 (Central Processing Unit), which can perform various appropriate actions and processes according to a program stored in ROM 502 (Read-Only Memory) or a program loaded from storage into RAM 503 (Random Access Memory). RAM 503 also stores various programs and data required for system operation. The CPU 501, ROM 502, and RAM 503 are interconnected via bus 504. An I / O interface 505 (Input / Output Interface) is also connected to bus 504.

[0202] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.

[0203] In particular, according to embodiments of the present invention, the above-described flowchart is as follows. Figure 1 The described process can be implemented as a computer software program. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by CPU 501, it performs the functions defined above in the system of the present invention.

[0204] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, RAM 503, ROM 502, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0205] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0206] The units described in the embodiments of the present invention can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself. The described units or modules can also be located in a processor; for example, a processor can be described as including a first generation module, an acquisition module, a search module, a second generation module, and a merging module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, the acquisition module can also be described as "an acquisition module for acquiring multiple instances to be probed in the base table".

[0207] The present invention also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement a large model memory management method as described in the above embodiments.

[0208] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.

Claims

1. A method for managing the memory of a large model, characterized in that, include: Obtain the new knowledge unit and the partition parameters corresponding to the new knowledge unit; Based on the partitioning parameters, the storage partition corresponding to the new knowledge unit in the knowledge base is determined. The storage partition includes at least: an active area, a stable area, and a cold storage area. Calculate the similarity between the new knowledge unit and each existing knowledge unit, and select existing knowledge units with similarity greater than a preset similarity threshold as candidate conflict objects; Calculate the conflict degree between each of the candidate conflict objects and the new knowledge unit, and process the new knowledge unit according to the conflict degree between each of the candidate conflict objects and the new knowledge unit to obtain a first processing result; Inject the first processing result into the corresponding storage partition; The partitioning parameters include at least: the importance and predicted usage probability of the new knowledge unit. Based on the partitioning parameters, the storage partition of the new knowledge unit is determined, including: Based on the importance and predicted usage probability of the new knowledge unit, calculate the matching score between the current new knowledge unit and the active area, stable area and cold storage area, and take the partition with the highest matching score as the storage partition; Based on the degree of conflict between each candidate conflicting object and the new knowledge unit, the new knowledge unit is processed, including: Candidate conflict objects with a conflict degree greater than a preset conflict degree threshold are selected as target conflict objects. Determine whether the target conflict object and the new knowledge unit are complementary; if they are complementary, merge them; if they are not complementary, acquire the importance and timeliness of the target conflict object and the new knowledge unit, and replace the new knowledge unit based on the comparison of their importance and timeliness.

2. The large model memory management method according to claim 1, characterized in that, Acquire new knowledge units, including: Receive a request to inject new knowledge and obtain the modal data carried by the new knowledge; The new knowledge unit is obtained by processing the modal data.

3. The large model memory management method according to claim 1, characterized in that, The method also includes: Obtain the historical activation parameters and inaccessible duration of existing knowledge units within the current knowledge base; Based on the historical activation parameters, the activation score of each existing knowledge unit is calculated; the historical activation parameters include at least: the number of activations within a preset period, importance, and access inverse function; If the activation score of the existing knowledge unit is greater than the preset promotion threshold, the existing knowledge unit is migrated to the stable area; if the activation score of the existing knowledge unit is less than the preset downgrade threshold, and the unaccessed time is greater than the preset cold storage elimination period, the existing knowledge unit is migrated to the cold storage area.

4. The large model memory management method according to claim 3, characterized in that, The method also includes: Obtain the duration during which the knowledge units in the cold storage area have not been accessed; The knowledge units whose unaccessed duration exceeds the preset cold storage and elimination period are marked as knowledge units that can be eliminated. Monitor the current capacity and access pressure of the knowledge base. When at least one of the capacity and access pressure exceeds the corresponding set threshold, delete the obsolete knowledge unit.

5. The large model memory management method according to claim 1, characterized in that, The method also includes: Monitor the risk status of the system and trigger a corresponding rollback request when the risk status is abnormal; Based on the rollback request, the system's historical data is restored.

6. The large model memory management method according to claim 1, characterized in that, The method also includes: Obtain the knowledge content of the new knowledge unit; Based on the knowledge content, determine whether the new knowledge unit contains data entries that need to be protected; If the new knowledge unit contains data entries that need to be protected, then the data associated with those data entries will be erased.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.

8. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Forgetting updating method and device of large language model, equipment, storage medium and program product

    CN120180128A

  • Knowledge base construction method, system and equipment based on large model

    CN120542552A