Method for processing memory data and related apparatus
By extracting the time anchor information of the memory data, actively calculating and persistently updating the current state value, the problem of balancing timeliness and historical traceability in existing technologies is solved, and a dynamic balance between the timeliness of the memory bank and historical information is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- IFLYTEK CO LTD
- Filing Date
- 2026-06-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies struggle to balance timeliness maintenance and historical traceability when managing memory data with time attributes, resulting in insufficient data timeliness or loss of historical information.
By extracting the time anchor information of the memory data, the current state value is actively calculated and persistently updated. The original state value is archived as historical traceability data, and an isolation mechanism is set up to facilitate traceability query.
This ensures that the data in the memory bank always reflects the latest state, improves data retrieval efficiency and timeliness, and preserves the complete historical evolution trajectory, thus resolving the contradiction between timely updates and the retention of historical information.
Smart Images

Figure CN122432356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence data processing technology, and in particular to a method and related apparatus for processing memory data. Background Technology
[0002] Currently, in applications such as intelligent dialogue systems and personal agents, long-term memory systems are the core infrastructure for maintaining the continuity of interaction. As the time users spend interacting with the system increases, the memory bank accumulates a large amount of data containing time attributes, such as the user's age, job title, education level, or current status. This data has significant time-sensitivity characteristics, and its corresponding real-world values evolve over time.
[0003] Existing technologies typically employ two approaches when managing this type of time-related memory data: one approach is to perform temporary calculations based on the original record during a query to obtain the current value, but the calculation results are not written back to the memory bank, resulting in the long-term retention of expired historical values in the memory bank. Each query requires repeated calculations and fails to reflect the latest state of the data. The other approach is to directly perform physical deletion or filtering operations on memory data that has exceeded the preset validity period. Although this method cleans up expired data, it leads to the permanent loss of historical information traces, making the system unable to respond to source queries about historical states.
[0004] It is evident that existing technologies suffer from the problem of balancing the timeliness of temporal memory data maintenance with historical traceability. Therefore, how to ensure the timeliness of memory data while fully preserving the historical evolution trajectory for traceability has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of the above problems, this application provides a method and related apparatus for processing memory data, so as to achieve the purpose of active calculation, persistent updating and traceable archiving of memory data containing time anchors. The specific solution is as follows:
[0006] The first aspect of this application provides a method for processing memory data, including:
[0007] Acquire target memory data and extract the time anchor information corresponding to the target memory data; the time anchor information includes the temporal type of the target memory data;
[0008] In response to the temporal type satisfying the preset calculation conditions, the current state value of the target memory data is calculated based on the time anchor information;
[0009] The current state value is persisted to the memory to replace the original state value of the target memory data, and the original state value is archived as historical traceability data. The historical traceability data is not visible in regular retrieval, but can be retrieved when preset traceability query conditions are met.
[0010] In one possible implementation, the temporal type satisfying the preset calculation conditions includes the temporal type being one of linear accumulation type, state transition type, and periodic decay type;
[0011] The step of calculating the current state value of the target memory data based on the time anchor information includes:
[0012] If the temporal type is the linear cumulative type, the original state value is monotonically increased based on the time difference between the current time information and the anchor time in the time anchor information to obtain the current state value;
[0013] If the temporal type is the state transition type, in response to detecting a state transition trigger signal, the original state value is updated to the current state value after the transition;
[0014] If the temporal type is the periodic decay type, calculate the remaining valid time, and when the remaining valid time is less than a preset time threshold, add an expired status flag to the current status value.
[0015] In one possible implementation, the step of persistently writing the current state value to the memory bank to replace the original state value of the target memory data includes:
[0016] Retrieve existing memory data in the memory bank that belongs to the same entity and has the same semantic type as the target memory data;
[0017] In response to the fact that the first anchor time of the existing memory data is earlier than the second anchor time corresponding to the time anchor information, the existing memory data is archived and the current state value is written into the memory bank;
[0018] In response to the first anchor time being later than the second anchor time, the current state value is discarded, and the calculation is re-executed based on the existing memory data;
[0019] In response to the first anchor time being the same as the second anchor time and the state value conflicting, the system determines to retain the current state value or the existing memory data based on the reliability of the data source, and marks the unretained data as pending adjudication.
[0020] In one possible implementation, before persisting the current state value to the memory bank to replace the original state value of the target memory data, the method further includes:
[0021] Perform a logical consistency check between the current state value and other memory data belonging to different semantic types in the memory bank;
[0022] In response to the detection of a cross-type logical contradiction between the current state value and the other memory data, both the target memory data and the other memory data are marked as semantically conflicting states;
[0023] Based on preset importance assessment rules, the importance scores of the target memory data are compared with those of the other memory data;
[0024] Keep data with high importance scores active, convert data with low importance scores to suspended status, and generate prompts for users to clarify in subsequent interactions.
[0025] In one possible implementation, extracting the time anchor information corresponding to the target memory data includes:
[0026] The target memory data is coarsely screened using a named entity recognition model to extract candidate temporal expressions;
[0027] The candidate time expression is parsed using a preset time parsing rule set to obtain the initial anchor time and initial confidence level;
[0028] In response to the initial confidence level being lower than a preset confidence threshold, a semantic verification model is invoked to perform contextual consistency verification on the initial anchor time to obtain the final anchor time; in response to the initial confidence level being greater than or equal to the preset confidence threshold, the initial anchor time is used as the final anchor time.
[0029] The time anchor information is generated based on the final anchor time.
[0030] In one possible implementation, archiving the original state values as historical traceability data includes:
[0031] Construct an archive data structure that includes the original text field, archive time field, archive reason field, replacement association identifier field, and search tag field;
[0032] The original text corresponding to the original state value, the timestamp of the archiving operation, the enumeration value of the reason for triggering the archiving, the new memory data identifier that replaces the original state value, and the retrieval tag used to indicate the historical state are written into the corresponding fields of the archive data structure, respectively.
[0033] The status attribute of the archived data structure is set to archived status so that the archived data structure can be filtered in regular retrieval based on semantic similarity and recalled based on the search tag field when the preset source tracing query conditions are met; the preset source tracing query conditions include: receiving a source tracing query request containing keywords of historical query intent, or detecting keywords of questioning intent against the current status value.
[0034] In one possible implementation, the method further includes:
[0035] Acquire newly added memory data and determine the scope attribute of the newly added memory data;
[0036] Retrieve existing memory data that semantically conflicts with the newly added memory data from the memory bank, and obtain the scope attribute of the existing memory data;
[0037] In response to the fact that the scope attribute of the newly added memory data is different from the scope attribute of the existing memory data, the coexistence state of the newly added memory data and the existing memory data is maintained in the memory bank;
[0038] In response to receiving a data retrieval request, based on the scene semantic features corresponding to the data retrieval request, the target memory data is selected from the newly added memory data and the existing memory data that are in a coexisting state and returned.
[0039] In one possible implementation, the scope attribute includes long-term stable attributes and temporary context attributes;
[0040] Determining the scope attribute of the newly added memory data includes:
[0041] Detect whether the newly added memory data contains explicit time-limited words; if it does, then determine the candidate scope attribute as a temporary context attribute.
[0042] If the explicit time qualifier is not included, the implicit semantic features of the newly added memory data are detected, and the stable attribute description and task-related request are distinguished based on the implicit semantic features to determine the candidate scope attribute.
[0043] Perform ambiguity checks on the candidate scope attributes to verify whether the newly added memory data contains implicit signals that contradict the candidate scope attributes;
[0044] In response to the ambiguity check, the candidate scope attribute is determined as the final scope attribute, and a valid timestamp is associated with the final scope attribute belonging to the temporary context attribute.
[0045] In one possible implementation, the method further includes:
[0046] In response to the fact that the scope attribute of the newly added memory data is the temporary context attribute and the scope attribute of the existing memory data is the long-term stable attribute, the step of maintaining the coexistence state of the newly added memory data and the existing memory data is executed.
[0047] In response to the fact that the scope attribute of the newly added memory data and the scope attribute of the existing memory data are both the long-term stable attribute, the existing memory data is archived and the newly added memory data is written into the memory bank;
[0048] In response to the fact that the scope attribute of the newly added memory data and the scope attribute of the existing memory data are both the temporary context attribute, the existing memory data with the earlier time is archived based on the time sequence, and the newly added memory data with the later time is written into the memory bank.
[0049] In one possible implementation, the step of selecting target memory data for return from the newly added memory data and the existing memory data that are in a coexisting state, based on the scene semantic features corresponding to the data retrieval request, includes:
[0050] The memory data associated with the temporary context attribute with the valid timestamp is monitored, and in response to the current time exceeding the valid timestamp, the state of the memory data is changed to an invalid state so that the memory data is not involved in regular retrieval;
[0051] Parse the data retrieval request and detect whether the data retrieval request contains specific time-limited words;
[0052] In response to the inclusion of the specific time-limiting word, the target memory data is preferentially selected from the memory data of the temporary contextual attribute that is in a valid state;
[0053] In response to the absence of the specific time-limiting term, the target memory data is preferentially selected from the memory data of the long-term stable attributes.
[0054] In one possible implementation, prior to performing the step of acquiring the target memory data, the method further includes:
[0055] Calculate the multidimensional importance score of each memory data entry in the memory bank;
[0056] Based on the multidimensional importance score of each memory data, the problematic memory data in the memory bank are weighted and accumulated to obtain the memory dirtiness index; wherein, the problematic memory data includes conflicting memory data, outdated memory data, and unresolved memory data;
[0057] In response to the memory dirtiness index meeting the preset triggering condition, the step of obtaining the target memory data is triggered.
[0058] In one possible implementation, the preset triggering condition includes at least one of an active triggering condition and a passive triggering condition:
[0059] The active triggering conditions include: triggering standard cleanup when the memory dirtiness index reaches the basic threshold, or triggering emergency cleanup when the memory dirtiness index reaches the emergency threshold and there are conflicting memory data with multidimensional importance scores exceeding the preset importance threshold.
[0060] The passive triggering conditions include: maintenance and organization are triggered when the time since the last organization exceeds a preset time interval and the memory dirtiness index exceeds a minimum threshold.
[0061] In one possible implementation, the method further includes:
[0062] In response to the existence of conflict memory data in the conflict memory data where the multidimensional importance score exceeds a preset importance threshold, an urgency bias factor is calculated based on the highest multidimensional importance score;
[0063] The base threshold is reduced based on the urgency bias factor to obtain the reduced effective trigger threshold, so that high-importance conflict memory data can be preemptively cleaned up before the memory dirtiness index reaches the original base threshold.
[0064] In one possible implementation, after the compaction is triggered, the method further includes:
[0065] Based on at least one of the following: multidimensional importance score, conflict severity, expiration degree, and cascading effect, determine the priority score for organizing each piece of problem memory data;
[0066] The severity of the conflict is determined based on the product of the contradiction probability and the multidimensional importance score; the expiration degree is determined based on the ratio of the difference between the current time and the anchor time to the reference period; and the cascading effect is determined based on the number of other problem memory data that can be resolved in a chain after the current problem memory data is sorted out.
[0067] According to the sorting priority scores from high to low, the corresponding sorting operations are performed on each piece of problem memory data in sequence;
[0068] The conflict memory data includes semantic conflict memories caused by differences in scope attributes.
[0069] In one possible implementation, the step of triggering the acquisition of target memory data in response to the memory dirtiness index satisfying a preset trigger condition includes:
[0070] Based on the type of the problem-related memory data, it is diverted to the corresponding processing channel for processing operations; wherein, the processing channel includes:
[0071] The fast lane is used to process conflict memory data that meets preset simple conflict conditions, and executes conflict resolution through the rule engine;
[0072] The temporal channel is used to process the outdated memory data, perform current state value calculation based on time anchor information, and persistent write-back.
[0073] The adjudication channel is used to process complex conflict memory data that does not meet the preset simple conflict conditions, and calls the semantic model to perform conflict adjudication.
[0074] In one possible implementation, before performing a logical consistency check between the current state value and other memory data belonging to different semantic types in the memory bank, the method further includes:
[0075] The other memory data is determined through a three-level cascaded detection process, which includes:
[0076] The first level of detection calculates the vector similarity between the memory data corresponding to the current state value and each memory data in the memory bank, and identifies the memory data with a vector similarity greater than or equal to a preset similarity threshold as candidate conflict memory data.
[0077] The second-level detection performs entity alignment filtering on the candidate conflict memory data, retaining only candidate conflict memory data that have the same main entity and the same attribute type as the memory data corresponding to the current state value.
[0078] The third level of detection involves calling a natural language inference model on the candidate conflict memory data after entity alignment filtering to determine whether the semantic relationship is contradictory. Candidate conflict memory data that are determined to be contradictory are identified as other memory data.
[0079] In one possible implementation, the memory data in the memory bank has state attributes, including active state, archived state, pending conflict state, semantic conflict state, and temporary expiration state; the transition rules for the state attributes include:
[0080] In response to memory data being overwritten by newly added memory data or being replaced due to temporal calculation, the state attribute of the memory data is transferred from the active state to the archived state.
[0081] In response to the detection of a semantic conflict of the same type between two memory data that cannot be resolved by time arbitration, the state attribute of the memory data involved in the conflict is transferred to the conflict state to be resolved.
[0082] In response to the detection of a cross-type logical contradiction between the current state value and other memory data, the state attribute of the memory data involving the contradiction is transferred to the semantic conflict state;
[0083] In response to the expiration of a valid timestamp associated with memory data belonging to a temporary contextual attribute, the state attribute of the memory data is transferred from the active state to the temporary expired state.
[0084] A second aspect of this application provides a data processing apparatus, comprising:
[0085] An extraction unit is used to acquire target memory data and extract the time anchor information corresponding to the target memory data; the time anchor information includes the temporal type of the target memory data;
[0086] The calculation unit is used to calculate the current state value of the target memory data based on the time anchor information in response to the temporal type satisfying the preset calculation conditions.
[0087] The writing unit is used to persistently write the current state value to the memory bank to replace the original state value of the target memory data, and archive the original state value as historical traceability data. The historical traceability data is not visible in regular retrieval, but can be retrieved when preset traceability query conditions are met.
[0088] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the memory data processing method described in the first aspect or any implementation thereof.
[0089] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0090] The memory is used to store computer programs;
[0091] The processor is used to execute the computer program so that the electronic device can implement the memory data processing method of the first aspect or any implementation thereof.
[0092] The fifth aspect of this application provides a computer-readable storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the memory data processing method described in the first aspect or any implementation thereof.
[0093] By employing the aforementioned technical solution, the memory data processing method and related apparatus provided in this application establish a dynamic mapping relationship between memory data and the passage of real time by extracting time anchor information containing tense types. This enables the system to proactively calculate the current state value that conforms to the current real-world state based on the time anchor information. Furthermore, by persistently writing the calculated current state value into the memory bank to replace the original state value, this changes the passive mode of existing technologies that only temporarily calculates the state during queries without updating the stored state. This ensures that the data stored in the memory bank always reflects the latest calculation results, improving the efficiency and timeliness accuracy of data retrieval. Simultaneously, the replaced original state value is archived as historical traceability data, and an isolation mechanism is set that prevents it from being visible in regular searches but allows it to be retrieved when preset traceability query conditions are met. This avoids the interference of expired historical data with regular semantic search results while preserving the complete historical state evolution trajectory. This allows the system to maintain data freshness while possessing the ability to trace historical facts, resolving the contradiction between timeliness updates and historical information retention in temporal memory management. Attached Figure Description
[0094] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0095] Figure 1 A flowchart illustrating a method for processing memory data provided in an embodiment of this application;
[0096] Figure 2 This is a schematic diagram of the structure of a data processing device for storing memories, provided in an embodiment of this application.
[0097] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0098] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0099] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0100] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0101] Example 1
[0102] Reference Figure 1 , Figure 1 A flowchart illustrating a method for processing memory data provided in an embodiment of this application is shown below. Figure 1 As shown in the embodiments of this application, a method for processing memory data may include the following steps, which are described in detail below.
[0103] Step S101: Obtain target memory data and extract the time anchor information corresponding to the target memory data. The time anchor information includes the temporal type of the target memory data.
[0104] Specifically, target memory data refers to data records stored in a memory bank that contain time-related attributes. These records can be in the form of natural language text, structured triples, or key-value pairs. Examples include: "The user celebrated their 7th birthday in 2022" (stored in 2024); "The user is currently an engineer" (stored in 2022); "The user is a sophomore in college" (stored in 2023), etc.
[0105] Time anchor information is not just a simple timestamp, but a multi-dimensional structured data object, including at least one of the following: memory generation timestamp (session time), time expression (such as "the year before last", "two years ago", "last year"), anchor time, semantic value type (such as AGE / JOB_TITLE / STUDY_YEAR / ...), semantic value of anchor time (such as "7 years old", "engineer", "sophomore year", etc.), tense type (such as A-linear cumulative type, B-state transition type, C-periodic decay type, D-permanent stable type), and confidence level (such as high-containing precise year, medium-containing fuzzy expression, low-highly fuzzy).
[0106] For ease of understanding, for example, when the target memory data is obtained as "I turned 7 two years ago" mentioned by the user in a conversation on April 1, 2024, and the current time is April 9, 2026, the time anchor information extracted by the system includes the time expression t_expr="two years ago", the anchor time t_resolved=2022-04-01, the semantic value of the anchor time v_value=7 years old, the semantic value type v_type=AGE, and the tense type mem_type=A (linear cumulative type).
[0107] This structured anchor point extraction method provides the necessary basic parameters for subsequent accurate identification of data evolution patterns, avoiding the accumulation of errors caused by relying solely on unstructured text for fuzzy inference.
[0108] In this embodiment, temporal type is used to characterize the inherent pattern of data state changes over time. In one possible implementation, temporal types include linear cumulative, state transition, periodic decay, and permanently stable types.
[0109] This classification method is not a simple listing of mathematical models, but an abstract generalization based on the inherent physical laws governing the changes of data attributes over time in the real world. Different real-world attributes follow different time evolution logics. For example, age, length of service, and length of marriage are linearly cumulative, monotonically increasing over time and can be accurately predicted; job title and education level (currently enrolled) are state-transitional, jumping between finite sets of states; annual goals, current projects, leases, and pregnancy are cyclically decaying, periodically reset or having a natural expiration date; place of birth, parents' names, and blood type are permanently stable and do not change over time.
[0110] By categorizing the complex and diverse memory data into these four macro-types, the system can match the processing strategy that best conforms to the objective evolution logic of data of different natures, thereby avoiding the inference distortion or logical paradox caused by using a single general algorithm to process all temporal data.
[0111] The process of determining the tense type is essentially a process of mapping unstructured memory content to a predefined mathematical or logical model. Only by accurately determining the tense type can subsequent calculation steps adopt the correct algorithmic strategy and prevent logical errors such as calculating "position" by adding "age".
[0112] Step S102: In response to the temporal type satisfying the preset calculation conditions, the current state value of the target memory data is calculated based on the time anchor information.
[0113] The preset estimation conditions are used to filter out data types with clear time dependencies and suitable for automatic updates, excluding permanently stable data such as birthplace and blood type. In one possible implementation, the temporal type that satisfies the preset estimation conditions includes one of the following: linear cumulative type, state transition type, and periodic decay type.
[0114] When the target memory data is identified as a temporal type that meets the preset calculation conditions, the system executes the corresponding calculation logic based on the time anchor information to calculate the current state value of the target memory data.
[0115] It is important to emphasize that this calculation process is actively performed in the background and does not depend on real-time user query requests. This proactive calculation mechanism ensures that the memory is always up-to-date with the real world, fundamentally different from the passive mode in existing technologies that only calculates temporarily during queries, resulting in the storage layer retaining expired values for a long time.
[0116] Step S103: The current state value is persisted to the memory to replace the original state value of the target memory data, and the original state value is archived as historical traceability data. The historical traceability data is not visible in regular retrieval, but can be retrieved when the preset traceability query conditions are met.
[0117] Persistent writing refers to writing the calculated current state value as a new valid record to the storage medium, making it the default data source for all subsequent read operations, thereby completely replacing the expired original state value. Simultaneously, to ensure the complete traceability of data evolution, the system does not directly physically delete the original state value, but instead converts it into historical traceability data for archiving. The archived historical traceability data is tagged with specific state tags in the storage structure, causing it to be automatically filtered and masked in regular retrieval based on semantic similarity, preventing expired historical information from interfering with current dialogue understanding or recommendation results.
[0118] However, when the system receives a source query request containing keywords related to historical query intent such as "before," "at that time," or "when I was a child," it activates a dedicated retrieval channel for archived data, allowing users to trace back to a specific point in time. For example, when a user asks, "Do you remember how old I was when I was a child?", the system can retrieve the record "7 years old in 2022" from the archived data and generate an answer.
[0119] This dual mechanism of "routine isolation and on-demand tracing" ensures both the purity and accuracy of the memory bank when processing current tasks, while preserving a complete chain of historical facts, effectively resolving the contradiction between data updates and historical preservation.
[0120] Through steps S101 to S103 described above, this embodiment establishes a complete system for preserving and tracing the temporal context of memory data. This system ensures the accuracy of the calculation basis through structured anchor point extraction, eliminates computational delays and data lags during queries through proactive persistent write-back, and achieves a dynamic balance between timeliness and traceability through an isolated archiving mechanism. It should be understood that although this embodiment uses age calculation as an example, this process is also applicable to various data processing scenarios with time-evolution attributes, such as seniority calculation, membership validity management, and project progress tracking. As long as they meet the preset temporal type and calculation conditions, they can be included within the scope of protection of this invention.
[0121] Example 2
[0122] Based on the above embodiments, this embodiment further details the specific implementation method of calculating the current state value of the target memory data based on time anchor information in response to the temporal type satisfying the preset calculation conditions.
[0123] In this embodiment, the temporal type that satisfies the preset calculation conditions includes one of the following: linear accumulation type, state transition type, and periodic decay type.
[0124] Specifically, if the temporal type is linear cumulative, the original state value is monotonically increased based on the time difference between the current time information and the anchor time in the time anchor information to obtain the current state value.
[0125] Linear cumulative types are suitable for data attributes that exhibit continuous, unidirectional growth characteristics over time. Examples include a user's age, length of service, length of marriage, or cumulative membership duration. During the calculation, the system first calculates the time difference between the current system time and the anchor time recorded in the time anchor information. Then, it converts this time difference into the same unit of measurement as the original state value and adds it to the original state value to obtain the current state value.
[0126] For ease of understanding, let's take age estimation as an example. If the target memory data record is "User was 7 years old on April 1, 2022", and the current time is April 9, 2026, then the time difference is 4 years and 8 days. The system performs a monotonically increasing calculation on the original state value "7", that is, 7 plus 4, to obtain the current state value "11". It should be understood that although an integer year is used as an example here, in actual applications, the precision of the monotonically increasing calculation can be adjusted according to business needs. For example, in a preferred implementation, if the memory bank also stores the user's precise birth date information, the system can further determine whether the birthday of the current year has passed: if it has, the number of whole years is directly added; if it has not, the number of whole years is added and then subtracted by one or kept at the original value, thus obtaining a more accurate age in weeks. If precise month and day information is lacking, the system can output "approximately 11 years old" as the current state value and mark the confidence level of the result as medium.
[0127] Taking the calculation of seniority as an example, if the original memory states "I was a fresh graduate when I joined this company three years ago," and the storage date is June 1, 2023, the system can parse the anchor time in the time anchor information as June 1, 2020 (i.e., three years ago), with a starting seniority of 0 years. The current time is April 14, 2026, a time difference of 5 years and 10 months. The system performs a monotonically increasing calculation on the original state value "0," obtaining the current state value of "approximately 5 years and 10 months of seniority." It should be understood that since the month and year of joining are known, the confidence level of this result can be marked as moderate. In an additional cross-memory logical reasoning, if the memory also stores "the user's company has a 3-month probationary period," the system can further calculate the official employment date: June 1, 2020 plus 3 months equals September 1, 2020. However, the confidence level of this additional inference is low and requires user confirmation.
[0128] This monotonically increasing mechanism based on time difference ensures that linear cumulative data can be automatically updated over time without requiring repeated statements from the user, thus maintaining the freshness of the basic profile data in the memory bank.
[0129] If the temporal type is a state transition type, in response to the detection of a state transition trigger signal, the original state value is updated to the current state value after the transition.
[0130] Unlike linear accumulation data, state transition data does not change continuously over time. Instead, state transitions occur at specific discrete points in time, and the state remains stable between these two points. Typical examples include a user's job title, education level, marital status, or place of residence. For this type of data, a simple time difference cannot directly deduce the current state; it must rely on the triggering of external events. Therefore, the deduction logic in this embodiment is transformed into monitoring and responding to state transition trigger signals.
[0131] For example, when the system recognizes semantic signals such as "recently promoted," "graduated," or "moved to a new house" from new dialogue data or external data sources, it determines that a state transition trigger signal has been detected. At this time, the system no longer performs time-based mathematical operations, but directly replaces the original state value (such as "junior engineer") with the new state value indicated by the trigger signal (such as "senior engineer"), or transitions to the next valid state according to preset state machine rules.
[0132] This approach respects the discrete nature of state transition data, preventing the system from erroneously creating intermediate states or non-existent job levels based on time duration, and ensuring the accuracy and logical compliance of state changes.
[0133] If the temporal type is a periodic decay type, the remaining valid time is calculated, and if the remaining valid time is less than the preset time threshold, an expired status flag is added to the current status value.
[0134] Cyclical decay types are typically used to describe data with a defined validity period, natural lifecycle, or periodically reset attributes, such as pregnancy dates, lease terms, project deadlines, or annual targets. For this type of data, the core task of the system is not to calculate a new, exact value, but rather to assess its current validity status.
[0135] Specifically, the system calculates the remaining valid time from the end of the validity period based on the anchor time and preset period parameters (such as the due date and contract expiration date) in the time anchor information. When the remaining valid time is detected to be less than the preset time threshold (e.g., less than 30 days remaining on the lease, or the due date has passed), the system does not directly delete the memory or blindly calculate a potentially inaccurate new value. Instead, it adopts a conservative strategy, adding an expired status marker (such as "POSSIBLY_OUTDATED" or "Pending Confirmation") to the current status value. For example, for memory data of "5 weeks pregnant", if the current time has passed the estimated due date, the system will mark it as potentially expired.
[0136] The technical advantage of this design is that it avoids information gaps caused by directly deleting data, and also prevents the risk of making incorrect inferences under uncertain circumstances (such as arbitrarily calculating a child's age after birth). The additional expiration status indicator can serve as a trigger for subsequent interactions, prompting the system to proactively request confirmation from the user at an appropriate time (for example, the next time the user mentions pregnancy, childbirth, or parenting, the system should prioritize requesting the user to proactively confirm the current status), thereby achieving closed-loop maintenance of the memory status while ensuring data security.
[0137] In summary, this embodiment distinguishes between three temporal types—linear accumulation, state transition, and periodic decay—and configures differentiated inference logic for each, enabling the state update method for memory data to accurately adapt to the diverse evolution patterns of real-world data. This classification processing mechanism not only improves the accuracy of the inference results but also enhances the robustness and security of the system when processing complex temporal data by introducing conservative strategies and triggering mechanisms.
[0138] Example 3
[0139] Based on the above embodiments, this embodiment further details the security verification mechanism before persistently writing the current state value into the memory.
[0140] To prevent information from being overwritten due to calculation errors or data disorder, this embodiment introduces a bidirectional time arbitration subprocess before performing persistent write operations.
[0141] Specifically, the process first retrieves existing memory data in the memory bank that belongs to the same entity and has the same semantic type as the target memory data. This step aims to identify potential conflicting objects. By limiting the data to the same entity and the same semantic type, irrelevant interference between different users or between different attribute dimensions of the same user (such as age and length of service) is eliminated, ensuring that subsequent comparisons are only performed between data records that are directly comparable.
[0142] After completing the retrieval, the system compares the first anchor time of the existing memory data with the second anchor time corresponding to the target memory data, and executes a differentiated decision strategy based on the comparison result. If the first anchor time of the existing memory data is earlier than the second anchor time corresponding to the time anchor information, the existing memory data is archived, and the current state value is written to the memory. This situation represents normal timeline evolution, where the newly calculated state value is located after the existing record on the timeline, reflecting the updated reality.
[0143] For example, if the existing memory stored in the memory bank shows that the user was 7 years old on April 1, 2022, and the current age is calculated to be 11 years old based on the time anchor point of April 9, 2026, the system determines that the calculation result is valid because 2022 is earlier than 2026. Therefore, the original record of 2022 is archived as historical traceability data, and the age of 11 is written into the memory bank as a new valid state.
[0144] This processing method ensures that the stored data can be automatically iterated to the latest state over time, maintaining the timeliness of the data.
[0145] As a key defensive mechanism, in response to the first anchor point time being later than the second anchor point time, the current state value is discarded, and the calculation is re-executed based on the existing memory data. This situation usually occurs when there are already data records in the memory bank that are newer than the current calculation benchmark. If results calculated based on the old benchmark are blindly written, the data state will be reversed on the timeline, causing information pollution.
[0146] For example, suppose the memory bank has already updated the record of the user being 10 years old on April 1, 2025, based on the user's direct statement from last year. The system is currently extrapolating from an earlier record of the user being 7 years old in 2022, arriving at an intermediate value of approximately 9 years old in April 2024. In this case, the anchor time of the existing record in 2025 is later than the extrapolation base time of 2024. Writing the 9-year-old record would incorrectly overwrite the more accurate 10-year-old record. Therefore, this embodiment chooses to discard the currently extrapolated 9-year-old result and instead use the newer, more reliable record of 10 years old in 2025 as the new extrapolation base to recalculate the state value at the current time point.
[0147] This reverse verification mechanism effectively prevents outdated information from overwriting new information, ensuring the monotonous increase of the memory timeline and the consistency of the data.
[0148] Furthermore, for special conflict scenarios where timestamps are completely identical but content is inconsistent, in response to the first anchor time and the second anchor time being the same and the status values conflicting, the current status value or existing memory data is retained based on the credibility of the data source, and the unretained data is marked as pending adjudication. When two records point to the same point in time but provide different facts, simple time-series comparison is ineffective, and the credibility of the source must be introduced as an arbitration basis. Generally speaking, the credibility of direct statements from users is higher than that of automatic calculations by the system, and the credibility of external authoritative data sources is higher than that of internal speculation.
[0149] For example, if the system calculates that a user is 11 years old on April 9, 2026, based on their birthday, but the user explicitly states that they are turning 12 today, then the user's statement is more credible. The system will retain the 12-year-old age as a valid value, while marking the calculated 11-year-old age as pending adjudication, to be reviewed manually or corroborated by more evidence. Conversely, if both conflicting results are calculated by the system, the decision to retain the age can be made based on the confidence score of the calculation model or the update timestamp of the data source.
[0150] By marking low-confidence data as pending adjudication instead of deleting it directly, the system ensures the accuracy of the main data stream while retaining anomalous samples for subsequent analysis or error correction, demonstrating the principles of prudence and fault tolerance in the data processing process.
[0151] In summary, this embodiment constructs a triple protection system encompassing forward updates, reverse rollback prevention, and same-source conflict resolution by adding a bidirectional time arbitration mechanism before the write-back operation. This mechanism not only solves the problem of merging multi-source heterogeneous data on the timeline but also significantly improves the robustness and self-correction capability of the memory in the face of complex data evolution by dynamically adjusting the calculation benchmark and retaining data to be adjudicated.
[0152] Example 4
[0153] Building upon the above embodiments, this embodiment further introduces a cross-type semantic paradox detection and suspension mechanism before write-back. While the bidirectional time arbitration in the above embodiments primarily resolves conflicts between old and new data of the same semantic type on the timeline, this embodiment focuses on the logical compatibility between data of different semantic types.
[0154] Specifically, before persisting the current state value to the memory, a logical consistency check is performed between the current state value and other memory data belonging to different semantic types in the memory. This step aims to prevent a single-dimensional calculation from being mathematically correct but contradicting other known facts in terms of common sense or business logic, thus causing the logical collapse of the overall profile of the memory.
[0155] For example, the system might accurately calculate a user's current age as 11 based on their birthday. However, if the database also contains a record of the user being a certified public accountant, these two sets of data, belonging to the age type and the professional qualification type respectively, might be valid within their respective semantic dimensions. But combined, they constitute a cross-type logical contradiction that violates common sense. By adding this global logical verification step before performing the write-back operation, the system can examine the rationality of the data from a multi-dimensional perspective, rather than being limited to updates on a single linear timeline.
[0156] When the system performs the above verification, in response to detecting a cross-type logical contradiction between the current state value and other memory data, it marks both the target memory data and other memory data as semantically conflicting. Here, a cross-type logical contradiction refers to a situation where the facts described by two or more memory data cannot simultaneously hold true in the same spatiotemporal context.
[0157] Unlike the conflicts of the same type mentioned above, where the outcome can be determined directly by the order of time, cross-type conflicts often imply that at least one side's data contains fundamental errors, and their authenticity cannot be determined solely by timestamps. Therefore, the system does not immediately perform overwrite or archiving operations, but instead first marks both sides' data with special semantic conflict markers. This approach avoids blindly accepting one side's data when the facts are unclear, thus preventing the spread of errors and preserving complete on-site evidence for subsequent human intervention or higher-level reasoning.
[0158] In order to maintain system availability as much as possible while ensuring data security, this embodiment also designs a graded handling strategy based on importance.
[0159] Specifically, based on preset importance assessment rules, the importance scores of the target memory data are compared with those of other memory data. The importance score can comprehensively consider multiple dimensions such as the credibility of the data source, the timeliness of the information, the coreness of the entity, and the frequency of historical access.
[0160] For example, the importance score of professional qualification information synchronized by users through the real-name authentication interface is usually significantly higher than that of age information automatically inferred by the system based on fuzzy text; or, core preference data that has been frequently retrieved recently may have a higher weight than background information that has not been activated for a long time. Through quantitative comparison, the system can make optimal temporary decisions when conflicts are unresolved, rather than simply blocking the reading of all relevant data.
[0161] Based on the comparison results above, data with higher importance scores is kept active, while data with lower importance scores is placed in a suspended state, and a prompt message is generated to request clarification from the user in subsequent interactions. Under this mechanism, high-scoring data continues to participate in regular retrieval and reasoning as valid knowledge, ensuring that the system's functionality remains unaffected in most scenarios; while low-scoring data is moved to the suspended area, neither participating in regular services nor being physically deleted, remaining in an intermediate state awaiting verification. Simultaneously, the system automatically generates a structured clarification request, which includes the specific content of both sides of the conflict and the reasons for the conflict. When the user touches on the relevant topic in subsequent conversations, or when the system detects an appropriate interaction opportunity, it will proactively release this prompt message to seek the user's confirmation or correction.
[0162] For example, the system might ask: According to the records, you are a certified public accountant, but based on your birthdate, you are currently only 11 years old. Which piece of information needs to be updated? This proactive human-machine collaborative error correction mechanism not only effectively prevents serious logical loopholes caused by automatic calculation errors, but also distributes the cost of data governance to daily interactions, achieving a continuous and gradual improvement in the quality of the data memory.
[0163] It should be understood that although this embodiment uses the contradiction between age and professional qualifications as an example for illustration, this cross-type verification mechanism is also applicable to the logical consistency verification between any two other semantic types such as education level and years of work experience, place of residence and commuting mode, family member relationship and age. As long as they meet the preset logical mutual exclusion or dependency conditions, they can be included in the protection scope of this invention.
[0164] Example 5
[0165] Building upon the above embodiments, this embodiment further details the specific implementation path for extracting the time anchor information corresponding to the target memory data. To effectively control computational resource consumption while ensuring the accuracy of time resolution, this embodiment employs a three-level cascaded extraction mechanism. This mechanism does not delegate all data processing tasks to a high-performance computing model; instead, it dynamically allocates processing resources based on the complexity of the data features. Through a strategy of step-by-step filtering and on-demand triggering, it achieves an optimal balance between accuracy and efficiency.
[0166] Specifically, the first-level processing uses a named entity recognition model to coarsely screen the target memory data and extract candidate temporal expressions.
[0167] In this stage, the system uses a lightweight named entity recognition model (such as spaCy / BERT-NER) to quickly scan the input target memory data, identifying text fragments that may contain temporal semantics as candidate temporal expressions. For example, for the target memory data "I celebrated my 7th birthday the year before last," the model will extract "the year before last" and "7 years old" as candidate temporal expressions. The main purpose of this step is to quickly locate potential temporal information from massive amounts of unstructured text, narrowing the scope of subsequent processing to a subset of memories containing only temporal expressions, thereby significantly reducing the overall computational load.
[0168] It should be understood that although this embodiment uses a named entity recognition model as an example, in other embodiments, lightweight tools such as regular expression-based matchers or keyword searchers can also be used to achieve the coarse screening function, as long as they can extract candidate time segments from the original text.
[0169] The second-level processing parses the candidate time expressions using a preset time parsing rule set to obtain the initial anchor time and initial confidence level.
[0170] The preset time parsing rule set includes various deterministic logics such as relative time rules, fuzzy time rules, and permanent labeling rules. For example, for relative time rules, when the candidate time expression is "the year before last" or "two years ago," the rule set parses it as the current year minus two years of anchor time and assigns it high confidence; when the candidate time expression is "last year" or "last month," it is similarly parsed as a precise anchor time (minus one year or one month) and assigned high confidence. For fuzzy time rules, when the candidate time expression is a highly vague expression such as "several years ago," the rule set will provide an initial anchor time corresponding to a default offset (e.g., three years), but will mark the initial confidence as low. When the candidate time expression is a vague expression such as "recently" or "not long ago," the rule set will provide an initial anchor time corresponding to an offset based on the most recent interaction interval (e.g., the average of the most recent interaction intervals), but will mark the initial confidence as medium. For permanent labeling rules, when the candidate time expression is an expression that does not have clear inference value, such as "when I was a child" or "when I was very young", the rule set will classify it as a permanent stable type and will not participate in subsequent temporal inference. In this case, the confidence level can be regarded as inapplicable.
[0171] This stage of processing leverages the regularity of time expressions in human language to solve most of the parsing problems of standard time formats with extremely low computational cost, and provides a quantitative basis for whether to call high-computing-power models later.
[0172] The third-level processing introduces a conditional triggering mechanism. Specifically, if the initial confidence level is lower than a preset confidence threshold, the semantic verification model is invoked to perform contextual consistency verification on the initial anchor time, yielding the final anchor time. Conversely, if the initial confidence level is greater than or equal to the preset confidence threshold, the initial anchor time is directly used as the final anchor time, skipping the semantic verification step.
[0173] This is the core feature that distinguishes this embodiment from the full-model processing scheme in the prior art. The system only activates a computationally expensive semantic verification model (such as LLM) when the second-level rule engine cannot provide a high-confidence result. The semantic verification model combines the complete context of the target memory data, the dialogue history, and common sense knowledge to perform in-depth verification and correction of the initial anchor time. For example, if the rule engine interprets "several years ago" as three years ago with low confidence, the semantic verification model may infer, based on the contextual clue of "just started elementary school," that a more logical time point should be six years ago, and correct the final anchor time to that value, while simultaneously increasing the confidence to high or medium.
[0174] Finally, time anchor information is generated based on the final anchor time.
[0175] After determining the final anchor time, it is used as the anchor time in the time anchor information. It is then combined with the memory-generated timestamp, time expression, semantic value type, semantic value of the anchor time, tense type, and confidence level to generate the time anchor information.
[0176] Through the aforementioned three-level cascaded extraction mechanism, this embodiment constructs an adaptive time anchor information parsing pipeline. For clearly expressed and well-defined time information, the system can complete high-precision parsing with minimal rule matching computational power; only when encountering ambiguous, unclear, or non-standard expressions is the semantic verification model invoked as a fallback. This design significantly reduces the average computational cost of the overall time anchor information extraction process compared to the full-model processing scheme (experimental results show a reduction of approximately 60% to 70%), while maintaining the ability to handle complex linguistic phenomena.
[0177] It should be understood that although this embodiment uses a three-stage pipeline as an example, in practical applications, the specific implementation tools for each stage, the setting of confidence thresholds, and the coverage of the rule set can all be adjusted according to specific business scenarios. For example, in scenarios with ample computing power, the preset confidence threshold can be appropriately lowered to increase the intervention frequency of the semantic verification model and further improve parsing accuracy; while in scenarios with extremely high real-time requirements, the rule set can be simplified and the threshold increased to prioritize response speed. These variations all fall within the protection scope of this invention.
[0178] Example 6
[0179] Building upon the above embodiments, this embodiment further details the specific implementation method for archiving original state values as historical traceability data. To ensure the purity of the current data in the memory while fully preserving the historical evolution trajectory, this embodiment employs a structured archiving mechanism.
[0180] Specifically, an archived data structure is constructed that includes fields for original text, archive time, archive reason, replacement association identifier, and search tag. This data structure is not a simple log record, but a self-describing knowledge unit with independent search capabilities.
[0181] By standardizing archived information into a specific set of fields, the system can perform full lifecycle state backtracking using only data within the repository, without relying on external documents or distributed logs. This structured design ensures that each piece of historical traceability data carries complete contextual metadata, providing a solid data foundation for subsequent multi-dimensional traceability queries.
[0182] After constructing the above archived data structure, the system will perform specific data population operations. The original text corresponding to the original status value, the timestamp of the archive operation, the enumeration value of the reason for triggering the archive, the new memory data identifier that replaces the original status value, and the retrieval tag used to indicate the historical status will be written into the corresponding fields of the archived data structure.
[0183] Among them, the original text field fully preserves the natural language expression before replacement, ensuring that the originality of historical facts is not tampered with; the archive time field records the precise moment when the state change occurred, providing a benchmark for timeline reconstruction; the archive reason field uses predefined enumerated values, such as TEMPORAL_INFERENCE_UPDATE indicating an update due to temporal extrapolation, ARBITRATION_DEFEATED indicating replacement in conflict adjudication, SCOPE_EXPIRED indicating archiving due to the natural end of the effective lifecycle defined by the scope attribute, and USER_CORRECTION indicating user-initiated correction, etc. This enumerated design facilitates the system to classify and statistically analyze or differentiate the display based on the change type; the replacement association identifier field stores the unique ID of the newly effective memory data, thereby establishing an explicit lineage link between the old and new data, supporting chained queries that trace back from the current state to any historical node; the retrieval tag field contains semantic tags such as historical, AGE, and JOB_TITLE, specifically used to assist targeted recall under specific intents.
[0184] It should be understood that although this embodiment lists the above five core fields, in actual applications, other auxiliary fields can be extended according to business needs, such as the unique identifier of the original memory corresponding to the original state value, state attributes, time anchor information, and parent archive ID, etc. As long as they serve the structured storage and retrieval of historical information, they all fall within the protection scope of this invention.
[0185] After the data is populated, the system sets the status attribute of the archived data structure to archived status so that the archived data structure can be filtered in regular retrieval based on semantic similarity and recalled based on the search tag field when the preset traceability query conditions are met.
[0186] The core of this mechanism lies in achieving logical read-write separation through state attributes. In typical dialogue understanding or recommendation scenarios, when performing vector similarity matching, the retrieval engine by default verifies the state attributes of each candidate data item, only including it in the result set if the state is active, thus automatically filtering out all historical data in an archived state. This filtering is performed dynamically during the retrieval phase, rather than through physical deletion or migration of storage locations, thus ensuring data transaction consistency and recovery capabilities.
[0187] The preset source tracing query conditions include two trigger scenarios. The first scenario is receiving a source tracing query request containing keywords related to historical query intent. When the system detects that the user's input contains historical query intent keywords such as "before," "at that time," "when I was a child," "originally," "past," or "you remember before" through the intent recognition module, it will automatically switch the retrieval strategy and activate a dedicated query channel for archived data. In this channel, the search engine is no longer limited by the filtering rules of status attributes, but instead prioritizes using the search tag field for metadata matching or weighted sorting, thereby accurately recalling historical records related to the user's source tracing needs.
[0188] For example, when a user asks, "Do you remember how old I was when I was a child?", the system can bypass the current record of being 11 years old and directly retrieve historical records tagged with "AGE" from the archived data that contain the original text of being 7 years old and generate an answer.
[0189] The second scenario involves detecting keywords indicating a questioning intent regarding the current state value. When a user questions the system's response based on the calculated result—for example, if the user's input contains keywords indicating a questioning intent such as "how is that possible?", "you calculated it wrong", "that's incorrect", or "I never said that"—the system will determine that the current calculated result may be biased. In this case, a dedicated query channel for archived data will be activated to retrieve historical traceability records related to the questioned data. By comparing the current calculated value with the historical original value, the system can show the user the complete chain of data evolution, helping the user confirm the correctness of the calculated result or discover potential errors in the calculation process.
[0190] For example, if the system answers that the user is currently about 11 years old, and the user questions whether the calculation is wrong, the system will automatically retrieve the original record of being 7 years old from the archived data and its anchor time of 2022, and show the user the reasoning: the record of being 7 years old in 2022 is now 4 years old, so the calculation is about 11 years old.
[0191] This question-driven tracing mechanism not only enhances the system's explainability and user trust, but also provides the system with an automated data error correction and feedback channel.
[0192] Through the synergistic cooperation of the two source tracing trigger scenarios and the state attribute filtering mechanism, this embodiment successfully achieves a dynamic balance between maintaining the timeliness of memory data and preserving the integrity of historical information. This avoids the interference of expired data with current services and gives the system the ability to trace back the truth of history at any time when users actively query or question the calculation results.
[0193] Example 7
[0194] Building upon the above embodiments, this embodiment further provides a conflict coexistence and scene-aware retrieval mechanism based on scope attributes. Unlike the previous embodiments, which focused on state updates in the time dimension, this embodiment aims to address the problem of mis-overwriting of memory data in the semantic dimension due to scope differences.
[0195] Specifically, the method further includes: acquiring newly added memory data and determining the scope attributes of the newly added memory data. Scope attributes are metadata tags used to characterize the time span and context-dependent nature of memory data. In this embodiment, scope attributes include at least long-term stable attributes and temporary contextual attributes. Long-term stable attributes typically correspond to a user's inherent preferences, identity characteristics, or habitual behaviors. This type of data has persistence across sessions and low-frequency change characteristics; for example, "likes spicy food" or "dislikes noisy environments." Temporary contextual attributes correspond to the immediate state in the current session, specific task requests, or short-term needs triggered by external environments. This type of data has strong timeliness and clear contextual binding characteristics, often containing qualifiers such as "today," "now," or "this time," for example, "doesn't want spicy food today" or "wants some quiet time now." By assigning scope attributes to newly added memory data, the system can fundamentally distinguish the lifecycle levels of data, providing a classification basis for subsequent differentiated conflict handling.
[0196] After determining the scope attributes of newly added memory data, the system retrieves existing memory data that semantically conflict with the new data from the memory database and obtains the scope attributes of the existing memory data. Here, semantic conflict refers to two sets of memory data describing seemingly inconsistent state values for the same attribute of the same entity object. However, this apparent inconsistency does not necessarily constitute logical mutual exclusion. Existing technologies often treat all semantic conflicts as data update events, employing a strategy of overwriting old values with new ones. This leads to a large number of temporary states incorrectly erasing long-accumulated steady-state knowledge.
[0197] This embodiment upgrades conflict determination from a simple numerical comparison to a multi-dimensional contextual analysis by introducing a comparison of scope attributes. Only when two pieces of data are at the same scope level are they considered to be a true version iteration conflict; when they are at different scope levels, they are identified as complementary multi-dimensional information.
[0198] In response to the difference in scope between newly added memory data and existing memory data, a coexistence state is maintained between the newly added memory data and existing memory data in the memory. Coexistence means that both data remain active and readable, without overwriting or archiving each other.
[0199] For example, when newly added memory data is "I don't want to eat spicy food today" and is identified as a temporary contextual attribute, while the existing memory data "I like spicy food" is identified as a long-term stable attribute, the system determines that their scopes are different. In this case, "I don't want to eat spicy food today" reflects the user's instantaneous need at a specific point in time due to physical discomfort or taste adjustment, while "I like spicy food" reflects the user's long-term taste preference statistics. These two data points are logically orthogonal, describing the user's "current state" and "essential attribute" respectively. If a traditional overlay strategy is adopted, the user's long-term dietary preference tags will be contaminated by a single, accidental, temporary choice, resulting in permanent profile distortion. By maintaining a coexistence state, the system fully preserves the user's true profile at different time granularities, respecting both current specific needs and protecting long-term core characteristics.
[0200] In order to achieve accurate utilization of data in the coexistence state, in response to the received data retrieval request, the target memory data is selected and returned from the newly added memory data and existing memory data in the coexistence state based on the semantic features of the scenario corresponding to the data retrieval request.
[0201] Scene semantic features are the results of in-depth analysis of the user's intent behind the search request, including but not limited to time orientation, task urgency, and topic domain. The system dynamically adjusts its recall strategy based on the analyzed scene semantic features. When a search request contains explicit time-limited words such as "today," "now," or "this time," or is identified as an immediate decision-making task (such as "recommend a restaurant tonight"), the scene semantic features point to a temporary context. The system will prioritize selecting target data from the valid temporary context attribute memory to ensure that the recommendation results match the user's current actual needs. Conversely, when a search request does not contain specific time-limited words, or is identified as a general task such as profile building or long-term preference analysis (such as "summarize the user's eating habits"), the scene semantic features point to long-term stability. The system will prioritize selecting target data from long-term stable attribute memory to avoid temporary noise interfering with the portrayal of the user's overall characteristics.
[0202] Through the above mechanism, this embodiment constructs a scope-aware, flexible memory management system. This system breaks through the limitations of the monistic truth value in traditional memory systems, acknowledging and accepting the multifaceted and dynamic nature of user states in the real world. Compared to simple overwriting or deletion, the coexistence mechanism, combined with scene-aware retrieval, enables the memory bank to maintain long-term knowledge stability while possessing a keen responsiveness to short-term contextual changes.
[0203] It should be understood that although this embodiment uses dietary preferences as an example, this mechanism is equally applicable to other data management scenarios where long-term and short-term states are intertwined, such as health status and exercise habits, work projects and professional skills, travel plans and place of residence. Furthermore, the division of scope attributes is not limited to long-term and temporary categories. In practical applications, more granular scope levels such as session-level, weekly-level, and monthly-level can be extended according to business needs. As long as they follow the core logic of cross-domain coexistence, intra-domain adjudication, and on-demand recall, they all fall within the protection scope of this invention.
[0204] Example 8
[0205] Building upon the above embodiments, this embodiment further details the specific decision-making mechanism for determining the scope attributes of newly added memory data. In this embodiment, scope attributes include long-term stable attributes and temporary contextual attributes. To accurately map unstructured natural language memory to these two types of scopes and avoid subsequent conflict resolution errors due to labeling mistakes, this embodiment employs a four-step automatic labeling decision-making process. This process, through progressively layered detection and verification logic, significantly improves the robustness of the labeling results while ensuring labeling coverage.
[0206] The first step is explicit detection. The system checks whether the newly added memory data contains explicit time-limited words. If it does, the candidate scope attribute is determined as a temporary context attribute.
[0207] Explicit time qualifiers refer to words or phrases that linguistically indicate a time range or contextual dependence. Specifically, these words include, but are not limited to, expressions such as "today," "tonight," "this time," "now," "at this moment," "temporarily," "temporarily," "the last few days," "this week," "this period," and "because...so today." When newly added memory data matches any of these words, the system initially classifies it as having a temporary characteristic. For example, for the memory data "I don't want to eat spicy food today, my stomach is upset," because it contains the explicit qualifier "today," the system directly marks its candidate scope attribute as a temporary contextual attribute.
[0208] This step leverages the strong features of the language surface, enabling the rapid identification of most explicit temporary states with extremely low computational cost, providing a high-confidence initial classification for subsequent processing.
[0209] The second step is implicit detection. If no explicit time qualifiers are present, the implicit semantic features of the newly added memory data are detected. Based on these implicit semantic features, stable attribute descriptions and task-related requests are distinguished to determine candidate scope attributes.
[0210] In actual interactions, a large amount of memory data does not carry explicit time adverbs, but its semantic connotation still implies scope information. In this case, the system needs to delve into the semantic level for analysis. Specifically, if the memory data describes inherent characteristics that are not easily changed over time, such as a user's identity, occupation, place of origin, long-term preferences, or values, such as "I am a surgeon" or "I don't like noisy environments," then its candidate scope attribute is determined as a long-term stable attribute. Conversely, if the memory data describes a specific task instruction, a request in the current session, or an immediate response to a specific event, such as "Book me a restaurant for tomorrow night" or "This plan isn't working," even without qualifiers like "today," the system will determine its candidate scope attribute as a temporary contextual attribute based on its task relevance. If it cannot be explicitly categorized, the system defaults to a conservative strategy, setting the candidate attribute as a long-term stable attribute to prevent the potential long-term knowledge from being misjudged as transient noise and lost. This step compensates for the blind spots of explicit detection, ensuring classification coverage of untagged data.
[0211] The third step is ambiguity checking, which is also the core defense against mislabeling in this embodiment. The system performs ambiguity checking on the candidate scope attributes to verify whether the newly added memory data contains implicit signals that contradict the candidate scope attributes.
[0212] Simple keyword matching or shallow semantic classification often struggles to handle the complexity of human language, easily leading to false positives or false negatives. Ambiguity checking aims to correct potential misjudgments through secondary verification.
[0213] Specifically, for candidate data marked as temporary contextual attributes, the system will check whether it lacks a reasonable time constraint or contextual background. For example, if a user simply says "I don't eat spicy food" without any contextual explanation, although it may be implicitly detected as a temporary request, ambiguity checking will find that it lacks implicit signals supporting its temporaryity, such as "because I'm sick" or "my throat hurts today," thus questioning the reliability of its temporaryity determination, and subsequently downgrading or reassessing it as a long-term stable attribute.
[0214] Conversely, for candidate data marked as having long-term stable attributes, the system checks whether implicit temporary signals are mixed in. For example, if a user says "I've always liked spicy food," although it contains the long-term signal "always," if the context immediately follows with "However, the doctor said I have to avoid spicy food this week," then the "avoid spicy food" constitutes a temporary signal that contradicts the long-term attribute, suggesting that the memory may be interfered with by a temporary state in the current context.
[0215] Through this two-way verification mechanism, the system can effectively identify and filter out ambiguous samples whose surface features are inconsistent with deep semantics, greatly reducing the labeling error rate caused by mechanical matching.
[0216] The fourth step is to output the final result. In response to the ambiguity check, candidate scope attributes are determined as final scope attributes, and valid timestamps are associated with the final scope attributes that belong to temporary context attributes.
[0217] Only data that has passed the first three screening steps and has not triggered ambiguity alerts will be confirmed as valid memory entries and written to the corresponding attribute tags. For data confirmed as temporary contextual attributes, the system will also automatically generate or infer a valid timestamp. This timestamp can be the expected end time of the current session, a deadline explicitly mentioned by the user (such as "before this Friday"), or a default validity period calculated based on historical interaction patterns. This timestamp is not only a component of the scope attribute but also a key basis for implementing automatic expiration and lifecycle management of temporary memories in subsequent embodiments. For data confirmed as long-term stable attributes, there is no need to associate such timestamps to keep it persistently active in the memory bank.
[0218] Through the aforementioned four-step decision-making mechanism, this embodiment constructs an automated annotation system that balances efficiency and accuracy. It ensures rapid capture of explicit information while resolving classification challenges in complex contexts through implicit analysis and ambiguity checking, laying a solid foundation for high-quality construction of the memory bank. It should be understood that although this embodiment uses dietary preferences and occupational identity as examples, this decision-making mechanism is equally applicable to the annotation of any type of memory data, such as health status, work projects, travel plans, and emotional tendencies. As long as it involves the distinction between long-term and short-term states, it can be included within the scope of protection of this invention.
[0219] Example 9
[0220] Building upon the above embodiments, this embodiment further details the differentiated conflict resolution rules based on scope attributes. This embodiment establishes three distinct processing strategies by subdividing the scope attribute combinations of new and old memory data, precisely adapting to the complex and ever-changing information update logic in the real world.
[0221] Specifically, in response to the fact that the scope attribute of newly added memory data is a temporary contextual attribute, while the scope attribute of existing memory data is a long-term stable attribute, a step is executed to maintain the coexistence of newly added memory data and existing memory data. This situation is the core feature that distinguishes this solution from the existing technology that invariably adopts a strategy of overwriting old values with new values.
[0222] When the system recognizes that new data only reflects the instantaneous state within a specific time window, while old data represents the user's inherent preferences across periods, the two are orthogonal rather than mutually exclusive in semantic space. For example, the memory bank stores the long-term stable attribute memory "the user likes spicy food," while newly added memory data is "today my stomach is upset, I don't want to eat spicy food" and is marked as a temporary contextual attribute. In this case, if an overwrite operation is performed, the user's long-term dietary preference profile will be permanently altered due to a single, accidental physical discomfort.
[0223] By maintaining a coexistence state, the system retains both the long-term characteristics of users as spicy food lovers and records their current special taboos, enabling subsequent searches to flexibly call up information at different levels according to the needs of the scenario, thereby effectively avoiding permanent information loss caused by scope confusion.
[0224] If both the scope attributes of newly added memory data and existing memory data are long-term stable attributes, the existing memory data is archived, and the newly added memory data is written to the memory. This situation is defined as true conflict overwriting.
[0225] Since the same long-term attribute of the same entity should have a unique and definite truth value in the same spatiotemporal context, when two memories that are both long-term stable attributes conflict semantically, it usually means that the user's inherent characteristics have undergone a substantial change, or that the previous record contained a factual error. For example, an existing memory record states "the user likes Sichuan cuisine" and is a long-term stable attribute, while a newly added memory explicitly states "my taste has changed, and I prefer Cantonese cuisine" and is also judged to be a long-term stable attribute. In this case, the old and new data cannot logically coexist, and the system must make a choice.
[0226] By archiving older or falsified memory data as historical source data and writing newly added memory data reflecting the latest facts into the memory bank as active data, the system completes the iterative update of the user's long-term profile. This approach ensures the consistency and accuracy of the long-term knowledge base, while preserving the trajectory of preference evolution through the archiving mechanism, supporting subsequent analysis of user interest migration.
[0227] Since both the scope attributes of newly added memory data and the scope attributes of existing memory data are temporary contextual attributes, older existing memory data is archived based on chronological order, while newer memory data is written to the memory bank. This situation is called temporal overwriting.
[0228] Temporary contextual attributes are essentially snapshots of a user's immediate state at discrete points in time. This type of data inherently possesses exclusivity and timeliness. When a new temporary state arises, it often signifies that the old temporary state has ended or been superseded. For example, a user expresses a temporary need of "wanting a cup of coffee now" at 10 AM, and then expresses a new need of "wanting green tea now" at 11 AM. Although both of these data points belong to temporary contextual attributes, the latter is located after the former on the timeline, reflecting the latest flow of the user's intent. Based on the order of timestamps, the system archives the coffee request at 10 AM and writes the green tea request at 11 AM into the memory as the currently valid temporary state.
[0229] This time-based decision-making logic aligns with the state machine model of human behavior, ensuring that the system always makes decisions based on the latest context information when responding to immediate user requests, thus avoiding interference from outdated temporary instructions in the current interaction.
[0230] In summary, this embodiment achieves refined governance of memory conflicts by constructing a three-tiered adjudication system encompassing cross-domain coexistence, long-term co-domain coverage, and temporary co-domain temporal coverage. This system breaks through the single-dimensional update logic of traditional technical solutions, enabling the memory bank to distinguish, like human cognition, which are long-term beliefs that need to be upheld, which are short-term fluctuations that need to be tolerated, and which are outdated thoughts that need to be forgotten. This differentiated processing mechanism not only significantly improves the semantic fidelity of memory data management but also provides richer, more comprehensive, and common-sense user profile support for upper-layer applications.
[0231] It should be understood that although this embodiment mainly describes the combination rules of two typical scopes, long-term stable attributes and temporary context attributes, in practical applications, if the system defines more granular scope levels (such as session level, weekly level, monthly level, etc.), the corresponding adjudication strategy can also be derived by referring to the above logic. As long as it follows the basic principle that scopes coexist when they are orthogonal and adjudicate according to time or importance when the scopes are the same, it should be included in the protection scope of this invention.
[0232] Example 10
[0233] Based on the above embodiments, this embodiment further details the automatic expiration of temporary memory and the scene-aware retrieval and matching logic. The aforementioned embodiments solved the problem of the coexistence of temporary contextual attribute memory and long-term stable attribute memory, while this embodiment aims to improve the full life cycle management of temporary memory, ensuring that it can exit in an orderly manner after completing its specific spatiotemporal mission and be accurately activated when needed.
[0234] Specifically, the system continuously monitors temporary contextual attributes associated with valid timestamps. In response to the current time exceeding the valid timestamp, the system changes the state of the memory data to invalid, preventing it from participating in regular retrieval. This mechanism constitutes the end of the temporary memory's lifecycle. The valid timestamp can be the session end time, a user-specified deadline, or an expiration time calculated based on business rules. When the system clock passes this point, it means that the instantaneous state described by the memory is no longer valid or has lost its reference value in the real world. At this time, the system does not perform a physical deletion operation but instead updates its state to invalid. Memory data in an invalid state will be automatically filtered out by the retrieval engine's default filter and will no longer participate as a candidate result in regular retrieval based on semantic similarity.
[0235] The technical advantage of this design lies in its ability to fundamentally eliminate the continuous interference of expired temporary noise on long-term user profiles. For example, if a user's expression of "I don't want to eat spicy food today" remains active the next day, it will seriously mislead the restaurant recommendation algorithm. Through an automatic expiration mechanism, this memory is automatically removed from the active retrieval pool at midnight the next day or after the session ends, ensuring that the data participating in regular calculations in the memory bank always has timeliness validity, while the retained archived records leave room for possible historical backtracking later.
[0236] After implementing dynamic lifecycle management of temporary memory, this embodiment also constructs a scene-aware retrieval and selection mechanism to address the priority issue of data retrieval in a coexisting state.
[0237] Specifically, the system parses data retrieval requests and checks whether they contain specific time-limiting words. These words anchor the user's intent within the current or a specific short time window, such as "today," "tonight," "now," "this moment," and "this week." These words are key linguistic features that distinguish whether a user is expressing an immediate need or searching for general knowledge. By performing lexical analysis or semantic slot filling on the retrieval request, the system determines the presence of such limiting words, thereby inferring the semantic context of the search.
[0238] Based on the above detection results, the system implements a differentiated data selection strategy. In response to the presence of specific time-limited keywords, it prioritizes selecting target memory data from temporary contextual attribute memory data that is currently in a valid state. When a time-limited keyword is detected, the system determines that the user's current intent is highly time-sensitive and belongs to the immediate decision-making scenario. In this case, even if there are semantically highly relevant long-term stable attribute memories in the memory bank, the system will assign a higher recall weight to temporary contextual attribute memories or directly return them at the top. For example, when a user asks "What should I eat tonight?", and the search request contains the specific time-limited keyword "tonight," the system will prioritize recalling and returning the temporary memory "My stomach isn't feeling well today, I want to eat something light" that is currently in a valid state, rather than the long-term memory "I like Sichuan cuisine."
[0239] This prioritization ensures that the system responds sensitively to the user's current situation, avoiding rigid services that use long-term average preferences to mask short-term urgent needs.
[0240] Conversely, in response to the absence of specific time-limited keywords, the system prioritizes selecting target memory data from memory data with long-term stable attributes. When no time-limited keywords are detected in the search request, the system assumes the user's intent is to obtain general, time-spanning, stable information, belonging to a profile building or long-term preference query scenario. In this case, the system will filter out or reduce the weight of temporary contextual attribute memories, prioritizing the return of long-term stable attribute memories. For example, when a user asks "What are my eating habits?" or the system executes the task of "generating user food tags" in the background, due to the lack of time-limited keyword constraints, the system will ignore temporary dietary restrictions that may still be valid, directly generating answers based on long-term stable memories such as "likes spicy food" or "prefers Cantonese cuisine."
[0241] This mechanism ensures that, in a general context, the system outputs robust knowledge that has been refined over time and represents the essential characteristics of the user, rather than occasional, transient states.
[0242] In summary, this embodiment achieves a closed-loop solution for the coexistence of scope conflicts through a dual mechanism of automatic invalidation and scene-aware retrieval. The automatic invalidation mechanism acts as a metabolic system for the memory bank, periodically cleaning up temporary data that has lost its timeliness value, thus maintaining the semantic purity of the storage space. The scene-aware retrieval mechanism acts as an intelligent routing system, accurately switching between coexisting long-term knowledge and temporary states based on spatiotemporal clues in user commands. The two mechanisms work together to ensure that the memory system neither overlooks the user's current changes due to excessive focus on long-term preferences, nor loses its grasp of the user's essential characteristics by capturing too much transient noise, truly achieving dynamic memory management that conforms to the laws of human cognition.
[0243] It should be understood that although this embodiment uses dietary preferences as an example for illustration, the mechanism is also applicable to any data processing field involving the interweaving of long-term and short-term states, such as health management, work arrangement, and emotion tracking. As long as it follows the core logic of "automatic blocking of expired data and activation on demand," it falls within the protection scope of this invention.
[0244] Example 11
[0245] Building upon the above embodiments, this embodiment further details the triggering mechanism prior to executing the memory data state update method. This embodiment introduces a memory dirtiness index calculation based on multidimensional importance scoring and a dual-track triggering mechanism to address the technical shortcomings of existing technologies where the cleanup trigger is unaware of the actual state of the memory bank and treats all conflicts equally.
[0246] Specifically, the system first calculates the multidimensional importance score of each piece of memory data in the memory bank. The multidimensional importance score is comprehensively evaluated from four dimensions.
[0247] The first dimension is entity centrality, which is the number of other memories in the entire memory graph in which the entity associated with a memory appears. After normalization, the centrality score is obtained. For example, a user's name entity may appear in multiple memories such as age, occupation, and family members, and its entity centrality is significantly higher than that of occasional mentions that only appear in a single memory.
[0248] The second dimension is access frequency, which means that the more times a memory is retrieved and accessed, the higher the system's dependence on that memory.
[0249] The third dimension is semantic criticality, which is initially scored by the semantic model upon data entry and then slightly decays over time. Identity information, core preferences, and key events score highly; occasional mentions and background information score low. For example, the initial score range for core user identity information (such as name, age, occupation, and family members) is 0.85 to 1.0; the initial score range for long-term stable preferences (such as dietary preferences and work habits) is 0.60 to 0.85; the initial score range for important event records (such as graduation, starting a new job, and marriage) is 0.50 to 0.75; the initial score range for general interests (such as favorite books and movie genres) is 0.30 to 0.55; and the initial score range for occasional mentions or background information is 0.05 to 0.30. Semantic criticality decreases slightly over time according to an exponential decay law, with a small decay coefficient (default 0.001 / day), resulting in only a slight decrease in semantic importance over several years. However, permanently stable memories do not participate in the decay.
[0250] The fourth dimension is temporal sensitivity. Memory with precise time anchors and calculable values scores 1.0, memory with vague time expressions scores 0.5, and memory without time attributes scores 0.0.
[0251] The four dimensions are multiplied by their respective weights and then summed to obtain the multidimensional importance score for each memory.
[0252] For ease of understanding, the multidimensional importance score of memory m can be expressed as:
[0253] MIS(m) = w1·I entity (m) + w2·I freq (m) + w3·I semantic (m) + w4·I temporal (m)
[0254] Wherein, the entity centrality is I entity The access frequency is I freq The semantic key is I semantic Temporal sensitivity is I temporal The weights for the four dimensions are w1, w2, w3, and w4, respectively.
[0255] After calculating the multidimensional importance score of each memory, the system performs weighted accumulation of the problem memory data in the memory bank to obtain the memory dirtiness index.
[0256] Problematic memory data is categorized into three types. The first type is conflict memory data, which consists of memories where semantic conflicts are detected. Its contribution is the multidimensional importance score multiplied by a conflict weighting coefficient. The second type is outdated memory data, which consists of temporal memories that have exceeded their expiration window. Its contribution is the multidimensional importance score multiplied by an outdated weighting coefficient, then multiplied by an expiration degree factor, which is obtained by dividing the difference between the current time and the anchor time by the reference period. The third type is unresolved memory data, which consists of problematic memories that have been triggered but not yet resolved. Its contribution is the multidimensional importance score multiplied by an unresolved weighting coefficient, then multiplied by the dependency chain depth, which reflects the degree to which this memory affects other memories. The sum of these three contribution values yields the memory dirtiness index.
[0257] For ease of understanding, the memory dirtiness index can be expressed as:
[0258]
[0259] in, A collection of conflicting memory data;
[0260] A collection of outdated memory data that has exceeded its expiration window;
[0261] A collection of unresolved memory data that has been triggered but not yet fully processed;
[0262] Expiration level; For the current time, For time anchor information, Generate timestamps for memories;
[0263] The depth of the dependency chain (entries that affect more other memories have greater weight).
[0264] The intuitive meaning of this quantitative indicator is that a conflict involving an incorrect user name (with a multidimensional importance score of approximately 0.95) contributes about 6 times more to the memory dirtiness index than a conflict involving a movie casually mentioned by a user (with a multidimensional importance score of approximately 0.15). The system will trigger cleanup earlier when the former occurs.
[0265] In response to the memory dirtiness index meeting the preset trigger conditions, the step of obtaining the target memory data is triggered.
[0266] The preset triggering conditions include two tracks: active triggering and passive triggering. Active triggering is state-driven, encompassing two scenarios: standard cleanup is triggered when the memory dirtiness index reaches a basic threshold, with the system processing problematic memories sequentially according to priority; emergency cleanup is triggered when the memory dirtiness index reaches an emergency threshold and conflicting memories with multidimensional importance scores exceeding a preset importance threshold exist, with the system immediately performing cleanup asynchronously in the background without blocking current user responses. Passive triggering is time-based, triggering maintenance cleanup when the time since the last cleanup exceeds a preset time interval and the memory dirtiness index exceeds a minimum threshold, preventing the long-term accumulation of minor issues. The basic threshold increases with the square root of the memory size, avoiding frequent cleanup triggers in large memories due to their large size, and also preventing ineffective cleanup triggers in small memories due to excessively low thresholds.
[0267] Through the above mechanism, this embodiment constructs a state-aware, on-demand tidying triggering system, fundamentally different from the blind triggering methods based on fixed message counts or fixed time intervals in existing technologies. The introduction of multi-dimensional importance scoring allows high-importance conflicts to receive a greater dirty contribution weight, thereby triggering a tidying response earlier; the dual-track triggering mechanism takes into account both immediate response and fallback protection, ensuring that the memory bank receives maintenance at an appropriate frequency under any state.
[0268] It should be understood that although this embodiment uses a four-dimensional importance score as an example for illustration, in actual applications, evaluation dimensions can be added or removed or weight ratios can be adjusted according to business needs. As long as it follows the core logic of weighted accumulation based on importance, it falls within the protection scope of this invention.
[0269] Example 12
[0270] Building upon the aforementioned embodiments, this embodiment further details the adaptive adjustment mechanism for the trigger threshold of the memory dirtiness index. In the previous embodiments, the memory dirtiness index needs to reach a basic threshold to trigger standard defragmentation. However, when a conflict of extremely high importance occurs in the memory (e.g., a user's name is incorrectly recorded), defragmentation should be triggered as soon as possible, even if the memory dirtiness index has not yet accumulated to the basic threshold; otherwise, the error will continue to have a negative impact on all subsequent interactions involving user identity.
[0271] To address this, this embodiment introduces an adaptive threshold adjustment mechanism. In response to the presence of conflict memory data with multidimensional importance scores exceeding a preset importance threshold, the system calculates an urgency bias factor based on the highest multidimensional importance score.
[0272] The urgency bias factor is calculated as follows: the smaller value between the highest multidimensional importance score divided by the reference divisor (default 1.25) and the upper limit (default 0.4). For example, when the highest multidimensional importance score is 0.95, the urgency bias factor is 0.95 divided by 1.25, which equals 0.76, and the upper limit is 0.4; when the highest multidimensional importance score is 0.50, the urgency bias factor is 0.50 divided by 1.25, which equals 0.40, and the upper limit is 0.40; when the highest multidimensional importance score is 0.25, the urgency bias factor is 0.25 divided by 1.25, which equals 0.20, and the upper limit is 0.20.
[0273] After calculating the urgency bias factor, the system lowers the base threshold based on this factor to obtain the reduced effective trigger threshold. The effective trigger threshold equals the base threshold multiplied by (1 minus the urgency bias factor). Continuing the example above, when the urgency bias factor is 0.40, the effective trigger threshold drops to 60% of the base threshold. This means that standard cleaning, which originally required the memory dirtiness index to reach the base threshold to trigger, now only needs to reach 60% of the base threshold to trigger. High-importance conflict memory data can be cleaned earlier, even before the memory dirtiness index reaches the original base threshold.
[0274] Taking a specific scenario as an example, suppose the memory bank currently has 400 memories, with a base threshold of 1.0, an emergency threshold of 0.70, and a minimum threshold of 0.20. When a newly added memory "My name is Li Si" conflicts with an existing memory "User name: Zhang San," the multidimensional importance score of the name-related memory is 0.97, exceeding the preset importance threshold of 0.9. At this time, the urgency bias factor is 0.40 (the upper limit), and the effective trigger threshold drops to 0.60. If the current memory dirtiness index is 0.65, although it has not reached the original base threshold of 1.0, it has exceeded the effective trigger threshold of 0.60. The system immediately triggers emergency cleanup, asynchronously executing conflict resolution in the background: the credibility of the user's direct statement "My name is Li Si" is 1.0, higher than the old memory, "Zhang San" is archived, and "Li Si" is written to an active state. In contrast, if the conflict only involves low-importance memories (such as "a movie mentioned by the user occasionally", with a multidimensional importance score of about 0.15), the urgency bias factor is close to zero, the effective trigger threshold is basically equal to the original base threshold, and the system will not prematurely trigger the cleanup due to low-importance conflicts.
[0275] Through the aforementioned adaptive threshold adjustment mechanism, this embodiment achieves a dynamic match between the sorting trigger sensitivity and the importance of conflicts. The more numerous and severe the high-importance conflicts, the lower the trigger threshold, and the faster the system response; low-importance conflicts will not trigger unnecessary sorting operations, avoiding waste of computational resources. This hierarchical response strategy allows the system to maximize the response speed to critical errors while maintaining sorting quality.
[0276] It should be understood that although this embodiment uses a specific urgent bias factor calculation formula and threshold parameters as an example, in actual applications, the reference divisor, upper limit value and threshold parameterization formula can be adjusted according to the business scenario. As long as it follows the core logic of reducing the trigger threshold for high-importance conflicts, it falls within the protection scope of this invention.
[0277] Example 13
[0278] Based on the above embodiments, this embodiment further details the priority ranking mechanism for the sorting tasks. In the aforementioned embodiments, when the memory dirtiness index meets the preset triggering conditions and sorting is triggered, there may be multiple problematic memory data in the memory bank that need to be processed. To maximize the efficiency of each sorting task, this embodiment introduces a priority ranking mechanism based on multi-dimensional factors.
[0279] Specifically, the system determines the priority score for organizing each problem memory based on at least one of the following: multidimensional importance score, conflict severity, expiration degree, and cascading effect. The multidimensional importance score directly reflects the global importance of the memory in the memory bank; memories with higher importance should be processed first. Conflict severity is determined by the product of the contradiction probability and the multidimensional importance score. The contradiction probability is represented by the contradiction classification probability value output by the semantic conflict detection model; a higher conflict severity indicates a greater threat to the consistency of the memory bank. Expiration degree is determined by the ratio of the difference between the current time and the anchor time to the reference period; memories with longer expiration times are more likely to have deviated significantly from reality and should be processed first to prevent the continuous propagation of erroneous information in subsequent interactions. Cascading effect is determined by the number of other problem memories that can be resolved in a chain reaction after organizing the current problem memory; a greater cascading effect indicates that the memory is a key node for multiple unresolved problems, and prioritizing its processing can resolve multiple related problems at once.
[0280] After calculating the priority score for each piece of problem memory data, the system performs corresponding sorting operations on each piece of problem memory data in descending order of priority score. The specific type of sorting operation depends on the category to which the problem memory data belongs: for conflicting memory data, conflict resolution is performed (such as overwriting or coexistence determination based on source credibility and chronological order); for outdated memory data, temporal estimation and write-back are performed (as described in Examples 1 to 6); for unresolved memory data, the corresponding sorting channel is re-executed according to its current state.
[0281] In this embodiment, conflict memory data includes semantically conflicting memories caused by differences in scope attributes. This design directly links the scope-based conflict coexistence mechanism in Embodiments 7 to 10 with the triggering system of the memory dirtiness index. Specifically, when newly added memory data and existing memory data have semantic conflicts due to differences in scope attributes (e.g., a conflict between the long-term stable attribute memory "likes spicy food" and the temporary contextual attribute memory "doesn't want spicy food today"), the conflict is included in the conflict memory data set and participates in the weighted cumulative calculation of the memory dirtiness index. Since the multidimensional importance score of dietary preference memories is usually between 0.60 and 0.85, which is considered medium to high importance, such conflicts contribute relatively highly to the memory dirtiness index, enabling the system to respond promptly and execute the correct coexistence decision, rather than using a simple overwrite strategy that leads to long-term preferences being incorrectly overwritten by temporary states.
[0282] Taking a specific scenario as an example, suppose that after the organization task is triggered, the memory bank contains the following three problematic memories: the first is a user name conflict (multidimensional importance score 0.97, contradiction probability 0.95, cascading impact on 5 associated memories), the second is a user age expiration (multidimensional importance score 0.80, expiration level 2.0, cascading impact on 2 associated memories), and the third is a user movie preference conflict (multidimensional importance score 0.15, contradiction probability 0.85, cascading impact on 0 associated memories). After the system comprehensively calculates the priority scores of each memory, the user name conflict has the highest priority (high importance, high contradiction probability, high cascading impact), followed by the user age expiration (medium-high importance, high expiration level), and the user movie preference conflict has the lowest priority (low importance, no cascading impact). The system first processes the user name conflict. After the decision is made, other pending memories that depend on that name entity may automatically obtain a basis for resolution; then it processes the user age expiration, performing temporal deduction and writing back; finally, it processes the user movie preference conflict. This sorting strategy ensures that the resource input-output ratio of each sorting task is maximized.
[0283] Through the aforementioned priority ranking mechanism, this embodiment achieves optimal allocation of sorting resources. The introduction of cascading effects enables the system to prioritize critical nodes that have far-reaching consequences, maximizing the chain reaction effect of a single sorting operation. The correlation between scope conflicts and memory dirtiness indicators ensures the organic integration of the three core innovations (temporal deduction write-back, coexistence of scope conflicts, and importance-weighted triggering) at the system level, forming a complete closed loop for memory sorting.
[0284] It should be understood that although this embodiment uses four priority factors as examples, in actual applications, factors can be added or removed or the weight ratio of each factor can be adjusted according to business needs. As long as it follows the core logic of sorting and organizing by priority, it falls within the protection scope of this invention.
[0285] Example 14
[0286] Building upon the above embodiments, this embodiment further details the parallel execution architecture of the sorting task. In the aforementioned embodiments, when the memory dirtiness index meets the preset triggering conditions, the system needs to perform specific sorting operations on the problem memory data to be sorted. To improve sorting efficiency and adopt the most suitable processing strategy for different types of problem memories, this embodiment introduces an architecture design with three parallel sorting channels.
[0287] Specifically, the system routes the problem-related data to the corresponding processing channel for processing based on the type of data. The processing channel includes three parallel channels: a fast channel, a temporal channel, and a decision channel.
[0288] The fast track is used to process conflict memory data that meets preset simple conflict conditions, and performs conflict adjudication through the rule engine. Preset simple conflict conditions refer to conflict scenarios that can be directly adjudicated by deterministic rules, without needing to invoke the computationally expensive semantic model. For example, when the time anchor information of two conflict memory data is clear and the time difference exceeds a preset threshold, the rule engine can directly determine whether to retain the newer memory data and archive the older memory data based on chronological order. Similarly, when one source of conflict memory data is a direct user statement and the other is automatically calculated by the system, the rule engine can directly determine whether to retain the user statement and mark the system calculation result as pending adjudication based on the credibility of the source. The advantages of the fast track are its high processing speed and low computational resource consumption, making it suitable for batch processing of large numbers of simple conflicts.
[0289] The temporal channel is used to process stale memory data, performing current state value calculation and persistent write-back based on time anchor information. The temporal channel essentially carries the complete process of the temporal reasoning write-back replacement engine described in the above embodiments, including steps such as temporal evolution type identification, current state value calculation, bidirectional time arbitration, and source tracing and archiving. When problem memory data is identified as stale memory data (i.e., temporal memory exceeding the expiration window), the system diverts it to the temporal channel, which actively calculates the current state value and persistently writes it to the memory bank, ensuring that the temporal-sensitive information in the memory bank always reflects the calculated current value.
[0290] The adjudication channel is used to handle complex conflict memory data that does not meet the preset simple conflict conditions, and invokes the semantic model to perform conflict adjudication. Complex conflict memory data refers to conflict scenarios that cannot be directly adjudicated by simple rules, such as two conflict memory data with similar time anchor information and comparable source credibility, or conflicts involving cross-type semantic paradoxes (such as the logical contradiction between age and professional qualifications as described in the above embodiment). For such conflicts, the system invokes a semantic model (such as a large language model) to perform in-depth analysis of the semantic relationship between the conflicting parties, comprehensively considering contextual information, common sense knowledge, and user historical interaction patterns, to generate adjudication suggestions or directly execute adjudication operations. Although the adjudication channel has a higher computational cost, it can handle complex scenarios that the fast channel cannot cover, ensuring the quality of processing.
[0291] Through the architecture design of the three parallel sorting channels described above, this embodiment achieves the classification, diversion, and parallel execution of sorting tasks. Simple conflicts are handled efficiently by the fast channel, outdated memories are proactively calculated and updated by the temporal channel, and complex conflicts are adjudicated through in-depth analysis by the adjudication channel. The three channels perform their respective functions and operate in parallel, significantly improving the overall sorting efficiency.
[0292] It should be understood that although this embodiment uses three channels as an example, in actual applications, channels can be added or merged according to business needs. As long as they follow the core logic of handling traffic by problem type, they all fall within the protection scope of this invention.
[0293] Example 15
[0294] Building upon the above embodiments, this embodiment further details the specific implementation path of semantic conflict detection. In the above embodiments, before performing cross-type semantic paradox detection, the system needs to identify other memory data that potentially conflict with the memory data corresponding to the current state value. To effectively control computational resource consumption while ensuring detection accuracy, this embodiment employs a three-level cascaded detection process.
[0295] The first level of detection is a coarse screening based on vector similarity. The system calculates the vector similarity between the memory data corresponding to the current state value and each memory data in the memory bank, and identifies the memory data with a vector similarity greater than or equal to a preset similarity threshold as candidate conflicting memory data.
[0296] Specifically, the system uses a pre-trained semantic embedding model to map each memory data entry into a high-dimensional vector representation. Then, it calculates the cosine similarity between the vector of the memory data corresponding to the current state value and the vectors of all memory data entries in the memory bank. A preset similarity threshold can be set to 0.75, meaning that only when the cosine similarity of the vectors of two memory data entries reaches 0.75 or higher is it included in the candidate conflict set. The purpose of this level of detection is to quickly narrow down the candidate conflict range and eliminate obviously irrelevant memory entries. For example, if the memory data corresponding to the current state value is "the user is currently about 11 years old," the vector similarity of "the user likes spicy food" in the memory bank is only 0.30, far below the threshold, and is directly excluded; while the vector similarity of "the user is a certified public accountant" is 0.82, exceeding the threshold, and is included in the candidate conflict set. The computational complexity of the vector coarse screening is O(N), where N is the total number of entries in the memory bank, resulting in low computational overhead.
[0297] The second level of detection is entity alignment filtering. The system performs entity alignment filtering on candidate conflict memory data, retaining only candidate conflict memory data that have the same main entity and attribute type as the memory data corresponding to the current state value.
[0298] Specifically, the system extracts the main entity (such as "the user" or "the user's spouse") and attribute type (such as "age," "occupation," or "dietary preference") from two memory data pairs. Only when the main entity and attribute type are identical is the candidate conflict memory data retained for the next level of detection. The purpose of this level of detection is to filter out false positives that are "semantically similar but have different entities." For example, if the memory data corresponding to the current state value is "the user likes spicy food," the candidate conflict memory data "the user's friend likes spicy food," although having high vector similarity, is filtered out because the main entities are different ("the user" and "the user's friend"). Entity alignment filtering is performed based on a rule engine, with extremely low computational overhead, and can further reduce the candidate conflict set by approximately 50% to 70%.
[0299] The third level of detection is the fine-grained natural language inference judgment. The system calls a natural language inference model on the candidate conflict memory data after entity alignment filtering to determine whether the semantic relationship is contradictory. Candidate conflict memory data judged as contradictory are classified as other memory data. The natural language inference model (such as DeBERTa-NLI) outputs three classification results: implication, neutral, and contradictory. When the probability value of a contradictory relationship is greater than or equal to a preset contradiction threshold (such as 0.80), the system determines that there is a semantic conflict between two memory data, classifying them as other memory data requiring cross-type logical consistency verification. Although this level of detection has a large computational cost, due to the filtering by the first two levels of detection, the actual number of candidate conflict pairs that need to be called on the natural language inference model has been reduced from O(N²) to O(N·k), where k is the average number of candidates (usually k does not exceed 20), making full-database conflict scanning still feasible in real-time even with large-scale memory databases (tens of thousands of entries).
[0300] Through the three-level cascaded detection process described above, this embodiment constructs a semantic conflict detection pipeline that balances accuracy and efficiency. Vector coarse screening quickly eliminates irrelevant entries, entity alignment filtering eliminates false positives, and natural language inference refines the final confirmation of conflict relationships. The three-level detection is progressive and filters step by step, concentrating computational resources on candidate conflict pairs that truly require in-depth analysis.
[0301] It should be understood that although this embodiment uses a three-level cascading as an example, in actual applications, the number of cascading layers or the specific implementation method of each level can be adjusted according to business needs. As long as it follows the core logic of filtering step by step to reduce computational overhead, it falls within the protection scope of this invention.
[0302] Example 16
[0303] Building upon the above embodiments, this embodiment further details the state attributes and transition rules of the memory data in the memory bank. In the above embodiments, the system sets the state attribute of the archived data structure to an archived state to achieve isolation between regular retrieval and source tracing queries. Based on this, this embodiment defines a complete memory state machine model, covering five states and their transition rules.
[0304] The memory data in the memory bank has state attributes, including five types: active, archived, pending conflict, semantic conflict, and temporarily expired. The active state indicates that the memory data is in a normal and usable state, participating in regular retrieval and inference; the archived state indicates that the memory data has been replaced or archived, not participating in regular retrieval but can be recalled through source tracing; the pending conflict state indicates that the memory data involves semantic conflicts of the same type that have not yet been resolved; the semantic conflict state indicates that the memory data involves cross-type logical contradictions that have not yet been resolved; and the temporarily expired state indicates that the memory data belonging to the temporary context attribute has exceeded its valid timestamp.
[0305] The transition rules for state attributes include the following four cases.
[0306] In response to memory data being overwritten by newly added memory data or replaced due to temporal estimation, the state attribute of the memory data is transferred from an active state to an archived state. This is the most common state transition scenario, corresponding to the write-back arbitration process and the archiving process in the above embodiments. For example, when the system calculates that the user is currently about 11 years old based on time anchor information and writes the calculation result into the memory bank, the original "user is 7 years old" memory data is replaced, and its state attribute is transferred from an active state to an archived state.
[0307] In response to the detection of a semantic conflict of the same type between two memory data points that cannot be resolved through time arbitration, the state attribute of the conflicting memory data is transferred to a pending conflict state. This situation corresponds to the special conflict scenario in the above embodiments where the timestamps are completely identical but the content is inconsistent. When two records point to the same point in time but provide different facts, and the credibility of the sources is quite similar and cannot be directly resolved, the system marks the conflicting memory data as a pending conflict state, waiting for subsequent user interaction to request clarification or obtain more evidence before re-resolving the issue.
[0308] In response to the detection of a cross-type logical contradiction between the current state value and other memory data, the state attribute of the contradictory memory data is transferred to a semantic conflict state. This scenario corresponds to the cross-type semantic paradox detection in the above embodiments. For example, when the system calculates that the user is currently about 11 years old, but the memory bank also contains a record stating that "the user is a certified public accountant," both cannot logically be true at the same time. The system marks both contradictory memory data as semantic conflict states, with the one of higher importance remaining active and participating in regular services, while the other is temporarily suspended pending clarification from the user.
[0309] In response to the expiration of a valid timestamp associated with memory data belonging to a temporary contextual attribute, the state attribute of the memory data is transferred from an active state to a temporarily expired state. This corresponds to the automatic expiration mechanism for temporary memories in the above embodiments. For example, if a user expresses "I don't want to eat spicy food today" on a given day, it is marked as a temporary contextual attribute and associated with a valid timestamp (such as 23:59 on that day). When the system clock passes this time point, the state attribute of the memory data is transferred from an active state to a temporarily expired state, and it no longer participates in regular retrieval, but an archived record is retained for possible future historical backtracking.
[0310] By constructing the five states and their transition rules described above, this embodiment provides a complete memory state machine model, offering a clear state framework for the full lifecycle management of memory data. Each state corresponds to specific visibility rules and subsequent processing strategies, while the state transition rules ensure that state changes of memory data in different scenarios have clear triggering conditions and processing paths.
[0311] It should be understood that although this embodiment uses five states as examples, other states (such as manual review state, data corruption state, etc.) can be extended according to business needs in actual applications. As long as they follow the core logic of state machine-driven memory management, they are all within the protection scope of this invention.
[0312] The above describes a method for processing memory data provided by the embodiments of this application. The following will describe the apparatus for performing the above-described method for processing memory data.
[0313] Please see Figure 2 , Figure 2 This is a schematic diagram of a data processing device for memory provided in an embodiment of this application. Figure 2 As shown, the data processing device includes:
[0314] Extraction unit 11 is used to acquire target memory data and extract time anchor information corresponding to the target memory data; the time anchor information includes the temporal type of the target memory data;
[0315] The calculation unit 12 is used to calculate the current state value of the target memory data based on the time anchor information in response to the temporal type satisfying the preset calculation conditions.
[0316] The writing unit 13 is used to persist the current state value to the memory bank to replace the original state value of the target memory data, and archive the original state value as historical traceability data. The historical traceability data is not visible in normal retrieval, but can be retrieved when preset traceability query conditions are met.
[0317] Each unit in the aforementioned data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the operations corresponding to each unit.
[0318] This application also provides an electronic device in its embodiments. (See reference...) Figure 3 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0319] like Figure 3 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0320] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0321] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the memory data processing methods provided in this application.
[0322] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the memory data processing methods provided in this application.
[0323] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0324] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0325] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0326] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for processing memory data, characterized in that, The method includes: Acquire target memory data and extract the time anchor information corresponding to the target memory data; the time anchor information includes the temporal type of the target memory data; In response to the temporal type satisfying the preset calculation conditions, the current state value of the target memory data is calculated based on the time anchor information; The current state value is persisted to the memory to replace the original state value of the target memory data, and the original state value is archived as historical traceability data. The historical traceability data is not visible in regular retrieval, but can be retrieved when preset traceability query conditions are met.
2. The method according to claim 1, characterized in that, The temporal type satisfies the preset calculation conditions, including that the temporal type is one of linear accumulation type, state transition type and periodic decay type; The step of calculating the current state value of the target memory data based on the time anchor information includes: If the temporal type is the linear cumulative type, the original state value is monotonically increased based on the time difference between the current time information and the anchor time in the time anchor information to obtain the current state value; If the temporal type is the state transition type, in response to detecting a state transition trigger signal, the original state value is updated to the current state value after the transition; If the temporal type is the periodic decay type, calculate the remaining valid time, and when the remaining valid time is less than a preset time threshold, add an expired status flag to the current status value.
3. The method according to claim 1, characterized in that, The step of persistently writing the current state value to the memory bank to replace the original state value of the target memory data includes: Retrieve existing memory data in the memory bank that belongs to the same entity and has the same semantic type as the target memory data; In response to the fact that the first anchor time of the existing memory data is earlier than the second anchor time corresponding to the time anchor information, the existing memory data is archived and the current state value is written into the memory bank; In response to the first anchor time being later than the second anchor time, the current state value is discarded, and the calculation is re-executed based on the existing memory data; In response to the first anchor time being the same as the second anchor time and the state value conflicting, the system determines to retain the current state value or the existing memory data based on the reliability of the data source, and marks the unretained data as pending adjudication.
4. The method according to claim 3, characterized in that, Before persisting the current state value to the memory bank to replace the original state value of the target memory data, the method further includes: Perform a logical consistency check between the current state value and other memory data belonging to different semantic types in the memory bank; In response to the detection of a cross-type logical contradiction between the current state value and the other memory data, both the target memory data and the other memory data are marked as semantically conflicting states; Based on preset importance assessment rules, the importance scores of the target memory data are compared with those of the other memory data; Keep data with high importance scores active, convert data with low importance scores to suspended status, and generate prompts for users to clarify in subsequent interactions.
5. The method according to claim 1, characterized in that, The extraction of the time anchor information corresponding to the target memory data includes: The target memory data is coarsely screened using a named entity recognition model to extract candidate temporal expressions; The candidate time expression is parsed using a preset time parsing rule set to obtain the initial anchor time and initial confidence level; In response to the initial confidence level being lower than a preset confidence threshold, a semantic verification model is invoked to perform contextual consistency verification on the initial anchor time to obtain the final anchor time; in response to the initial confidence level being greater than or equal to the preset confidence threshold, the initial anchor time is used as the final anchor time. The time anchor information is generated based on the final anchor time.
6. The method according to claim 1, characterized in that, The step of archiving the original state values as historical traceability data includes: Construct an archive data structure that includes the original text field, archive time field, archive reason field, replacement association identifier field, and search tag field; The original text corresponding to the original state value, the timestamp of the archiving operation, the enumeration value of the reason for triggering the archiving, the new memory data identifier that replaces the original state value, and the retrieval tag used to indicate the historical state are written into the corresponding fields of the archive data structure, respectively. The state attribute of the archived data structure is set to archived state so that the archived data structure can be filtered in regular retrieval based on semantic similarity and recalled based on the search tag field when the preset source tracing query conditions are met; the preset source tracing query conditions include: receiving a source tracing query request containing keywords of historical query intent, or detecting keywords of questioning intent against the current state value.
7. The method according to claim 1, characterized in that, The method further includes: Acquire newly added memory data and determine the scope attribute of the newly added memory data; Retrieve existing memory data that semantically conflicts with the newly added memory data from the memory bank, and obtain the scope attribute of the existing memory data; In response to the fact that the scope attribute of the newly added memory data is different from the scope attribute of the existing memory data, the coexistence state of the newly added memory data and the existing memory data is maintained in the memory bank; In response to receiving a data retrieval request, based on the scene semantic features corresponding to the data retrieval request, the target memory data is selected from the newly added memory data and the existing memory data that are in a coexisting state and returned.
8. The method according to claim 7, characterized in that, The scope attributes include long-term stable attributes and temporary context attributes; Determining the scope attribute of the newly added memory data includes: Detect whether the newly added memory data contains explicit time-limited words; if it does, then determine the candidate scope attribute as a temporary context attribute. If the explicit time qualifier is not included, the implicit semantic features of the newly added memory data are detected, and the stable attribute description and task-related request are distinguished based on the implicit semantic features to determine the candidate scope attribute. Perform ambiguity checks on the candidate scope attributes to verify whether the newly added memory data contains implicit signals that contradict the candidate scope attributes; In response to the ambiguity check, the candidate scope attribute is determined as the final scope attribute, and a valid timestamp is associated with the final scope attribute belonging to the temporary context attribute.
9. The method according to claim 8, characterized in that, The method further includes: In response to the fact that the scope attribute of the newly added memory data is the temporary context attribute and the scope attribute of the existing memory data is the long-term stable attribute, the step of maintaining the coexistence state of the newly added memory data and the existing memory data is executed. In response to the fact that the scope attribute of the newly added memory data and the scope attribute of the existing memory data are both the long-term stable attribute, the existing memory data is archived and the newly added memory data is written into the memory bank; In response to the fact that the scope attribute of the newly added memory data and the scope attribute of the existing memory data are both the temporary context attribute, the existing memory data with the earlier time is archived based on the time sequence, and the newly added memory data with the later time is written into the memory bank.
10. The method according to claim 9, characterized in that, The step of selecting target memory data for return from the newly added memory data and the existing memory data that are in a coexisting state based on the scene semantic features corresponding to the data retrieval request includes: The memory data associated with the temporary context attribute with the valid timestamp is monitored, and in response to the current time exceeding the valid timestamp, the state of the memory data is changed to an invalid state so that the memory data is not involved in regular retrieval; Parse the data retrieval request and detect whether the data retrieval request contains specific time-limited words; In response to the inclusion of the specific time-limiting word, the target memory data is preferentially selected from the memory data of the temporary contextual attribute that is in a valid state; In response to the absence of the specific time-limiting term, the target memory data is preferentially selected from the memory data of the long-term stable attributes.
11. The method according to claim 1, characterized in that, Before performing the step of acquiring the target memory data, the method further includes: Calculate the multidimensional importance score of each memory data entry in the memory bank; Based on the multidimensional importance score of each memory data, the problematic memory data in the memory bank are weighted and accumulated to obtain the memory dirtiness index; wherein, the problematic memory data includes conflicting memory data, outdated memory data, and unresolved memory data; In response to the memory dirtiness index meeting the preset triggering condition, the step of obtaining the target memory data is triggered.
12. The method according to claim 11, characterized in that, The preset triggering conditions include at least one of active triggering conditions and passive triggering conditions: The active triggering conditions include: triggering standard cleanup when the memory dirtiness index reaches the basic threshold, or triggering emergency cleanup when the memory dirtiness index reaches the emergency threshold and there are conflicting memory data with multidimensional importance scores exceeding the preset importance threshold. The passive triggering conditions include: maintenance and organization are triggered when the time since the last organization exceeds a preset time interval and the memory dirtiness index exceeds a minimum threshold.
13. The method according to claim 12, characterized in that, The method further includes: In response to the existence of conflict memory data in the conflict memory data where the multidimensional importance score exceeds a preset importance threshold, an urgency bias factor is calculated based on the highest multidimensional importance score; The base threshold is reduced based on the urgency bias factor to obtain the reduced effective trigger threshold, so that high-importance conflict memory data can be preemptively cleaned up before the memory dirtiness index reaches the original base threshold.
14. The method according to claim 11, characterized in that, After the cleanup is triggered, the method further includes: Based on at least one of the following: multidimensional importance score, conflict severity, expiration degree, and cascading effect, determine the priority score for organizing each piece of problem memory data; The severity of the conflict is determined based on the product of the contradiction probability and the multidimensional importance score; the expiration degree is determined based on the ratio of the difference between the current time and the anchor time to the reference period; and the cascading effect is determined based on the number of other problem memory data that can be resolved in a chain after the current problem memory data is sorted out. According to the sorting priority scores from high to low, the corresponding sorting operations are performed on each piece of problem memory data in sequence; The conflict memory data includes semantic conflict memories caused by differences in scope attributes.
15. The method according to claim 11, characterized in that, The step of triggering the acquisition of target memory data in response to the memory dirtiness index meeting a preset trigger condition includes: Based on the type of the problem-related memory data, it is diverted to the corresponding processing channel for processing operations; wherein, the processing channel includes: The fast lane is used to process conflict memory data that meets preset simple conflict conditions, and executes conflict resolution through the rule engine; The temporal channel is used to process the outdated memory data, perform current state value calculation based on time anchor information, and persistent write-back. The adjudication channel is used to process complex conflict memory data that does not meet the preset simple conflict conditions, and calls the semantic model to perform conflict adjudication.
16. The method according to claim 4, characterized in that, Before performing a logical consistency check between the current state value and other memory data belonging to different semantic types in the memory bank, the method further includes: The other memory data is determined through a three-level cascaded detection process, which includes: The first level of detection calculates the vector similarity between the memory data corresponding to the current state value and each memory data in the memory bank, and identifies the memory data with a vector similarity greater than or equal to a preset similarity threshold as candidate conflict memory data. The second-level detection performs entity alignment filtering on the candidate conflict memory data, retaining only candidate conflict memory data that have the same main entity and the same attribute type as the memory data corresponding to the current state value. The third level of detection involves calling a natural language inference model on the candidate conflict memory data after entity alignment filtering to determine whether the semantic relationship is contradictory. Candidate conflict memory data that are determined to be contradictory are identified as other memory data.
17. The method according to claim 16, characterized in that, The memory data in the memory bank has state attributes, which include active state, archived state, pending conflict state, semantic conflict state, and temporary expiration state. The transition rules for the state attributes include: In response to memory data being overwritten by newly added memory data or being replaced due to temporal calculation, the state attribute of the memory data is transferred from the active state to the archived state. In response to the detection of a semantic conflict of the same type between two memory data that cannot be resolved by time arbitration, the state attribute of the memory data involved in the conflict is transferred to the conflict state to be resolved. In response to the detection of a cross-type logical contradiction between the current state value and other memory data, the state attribute of the memory data involving the contradiction is transferred to the semantic conflict state; In response to the expiration of a valid timestamp associated with memory data belonging to a temporary contextual attribute, the state attribute of the memory data is transferred from the active state to the temporary expired state.
18. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the method for processing memory data as described in any one of claims 1 to 17.
19. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the memory data processing method as described in any one of claims 1 to 17.
20. A computer-readable storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the memory data processing method as described in any one of claims 1 to 17.