Intelligent agent memory auditing method and device based on double time axis and storage medium
By introducing a dual-timeline model into the intelligent agent memory system, the problem of confusion between facts and recording time in existing technologies is solved, enabling accurate backtracking and complete auditing of historical states, and meeting the compliance requirements of regulatory agencies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI FANTAI GEEK TECH CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-10
AI Technical Summary
Existing intelligent agent memory systems cannot accurately distinguish between the time when a fact is established and the time when the system records it, making it difficult to trace back historical states. They also lack structured preservation of the state evolution process and cannot meet the compliance audit requirements in regulatory scenarios.
A dual-time-axis model is adopted to record a first time parameter (the time when the external fact is established) and a second time parameter (the system recording time) for each memory data. The set of valid memory data is determined by joint judgment of the dual time axes, and a state evolution record is formed when the state fails and is updated, generating audit results.
It improves the ability to distinguish semantics over time, enhances the accuracy of historical state backtracking and the completeness of audit traceability, and supports compliance auditing and accountability.
Smart Images

Figure CN121636323B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an agent memory auditing method and device based on a double time axis and a storage medium. BACKGROUND
[0002] With the wide application of artificial intelligence technology in highly regulated fields such as finance, medicine, and law, agent systems gradually assume functions such as user state analysis, risk assessment, and decision assistance, and their output results may directly affect user rights and compliance responsibilities. Therefore, regulatory agencies have higher requirements for agent systems, requiring related systems to have traceability, explainability, and auditability to support post-check and responsibility identification.
[0003] The agent memory system, as an important basic component supporting agent decision-making, is used to store user preferences, state parameters, and historical interaction information, and its management method directly affects the system's ability to restore historical states. In existing technologies, the memory system mostly uses a single timestamp to record the data write time, or saves the data change process through version control, event tracing, and other methods, and some database systems introduce a double time sequence data model. However, the above technical solutions are mostly derived from general database or distributed system design, focusing on storage efficiency or data consistency, and are not adapted to the needs of agent memory in compliance auditing scenarios.
[0004] Specifically, existing technologies generally cannot distinguish between the time when the memory data is established on the external fact level and the time when the system learns and records the fact, making it difficult to accurately restore the memory content actually visible to the system at a specific time point when the historical state is backtracked. At the same time, the update of memory data often adopts an overwriting write, lacking structured preservation of the state evolution process, which is not conducive to forming a complete audit evidence chain. Therefore, the existing agent memory management technology cannot meet the requirements of historical state backtracking and responsibility auditing in regulatory scenarios. SUMMARY
[0005] Therefore, the embodiments of the present application provide an agent memory auditing method and device based on a double time axis and a storage medium to solve the problems of memory data time semantic confusion, difficulty in accurately backtracking the historical state, and incomplete audit basis in the existing technology.
[0006] In a first aspect, the embodiment of the present application provides a double-time-axis-based agent memory auditing method, which comprises the following steps: receiving memory data associated with a user identifier, and recording a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to define a time range in which the memory data is valid at an external fact level, and the second time parameter is used to define a system record time at which the memory data is written or updated by a system; when an auditing request containing a target time point is received, performing double-time-axis joint determination on the memory data based on the target time point to determine a set of valid memory data, wherein the double-time-axis joint determination comprises determining memory data that is within the time range at the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter; when new memory data corresponding to a target fact is received, performing state invalidation updating on existing memory data corresponding to the new memory data, wherein the state invalidation updating comprises updating, in the same transaction, an end time of the first time parameter of the existing memory data to a start time of the first time parameter of the new memory data, and writing the new memory data to form a state evolution record; generating an auditing result based on the set of valid memory data, and recording an auditing log corresponding to the auditing request, wherein the auditing result comprises the target time point and memory data identifier and time parameter information corresponding to the set of valid memory data.
[0007] In a second aspect, the embodiment of the present application provides a double-time-axis-based agent memory auditing device, which comprises: a receiving module, configured to receive memory data associated with a user identifier, and record a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to define a time range in which the memory data is valid at an external fact level, and the second time parameter is used to define a system record time at which the memory data is written or updated by a system; a determination module, configured to, when an auditing request containing a target time point is received, perform double-time-axis joint determination on the memory data based on the target time point to determine a set of valid memory data, wherein the double-time-axis joint determination comprises determining memory data that is within the time range at the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter; an updating module, configured to, when new memory data corresponding to a target fact is received, perform state invalidation updating on existing memory data corresponding to the new memory data, wherein the state invalidation updating comprises updating, in the same transaction, an end time of the first time parameter of the existing memory data to a start time of the first time parameter of the new memory data, and writing the new memory data to form a state evolution record; and a generating module, configured to generate an auditing result based on the set of valid memory data, and record an auditing log corresponding to the auditing request, wherein the auditing result comprises the target time point and memory data identifier and time parameter information corresponding to the set of valid memory data.
[0008] In a third aspect, the embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the above method when executing the computer program.
[0009] In a fourth aspect, the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0010] The above at least one technical scheme adopted by the embodiment of the present application can achieve the following beneficial effects:
[0011] By receiving memory data associated with a user identifier, and recording a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to define a time range in which the memory data is established on an external fact level, and the second time parameter is used to define a system record time at which the memory data is written or updated by the system; when an audit request containing a target time point is received, a double-time-axis joint determination is performed on the memory data based on the target time point to determine a set of valid memory data, the double-time-axis joint determination including determining memory data within the established time range at the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter; when new memory data corresponding to a target fact is received, state invalidation updating is performed on existing memory data corresponding to the new memory data, the state invalidation updating including updating the end time of the first time parameter of the existing memory data to the start time of the first time parameter of the new memory data in the same transaction, and writing the new memory data to form a state evolution record; an audit result is generated based on the set of valid memory data, and an audit log corresponding to the audit request is recorded, wherein the audit result includes the target time point and memory data identifier and time parameter information corresponding to the set of valid memory data. The present application can improve the memory time semantic discrimination ability, improve the historical state backtracking accuracy, and enhance the audit traceability integrity. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0013] Figure 1 is a flowchart of the agent memory audit method based on double time axis provided by the embodiment of the present application;
[0014] Figure 2FIG. 1 is a structural schematic diagram of an agent memory auditing device based on a double time axis provided by an embodiment of the present application.
[0015] Figure 3 FIG. 4 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0016] In the following description, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known systems, structures, circuits, and techniques have not been shown in detail in order not to obscure the understanding of this application.
[0017] With the in-depth application of artificial intelligence technology in highly regulated fields such as finance, medicine, and law, agent systems are playing an increasingly important role in decision-making assistance. In these fields, every suggestion and decision made by an agent can have a significant impact on users, so it is necessary to meet strict regulatory compliance requirements.
[0018] The agent memory system is a core component that supports agent decision-making, which stores user preferences, states, and historical interaction information. However, existing agent memory systems mainly focus on the storage and retrieval efficiency of memories, and generally lack support for historical state rollback and responsibility auditing capabilities.
[0019] In terms of time management of the agent memory system, existing technologies mainly use the following methods:
[0020] Single timestamp method: record a timestamp for each piece of memory data, usually the time when the data is written into the system. This method is derived from the timestamp management of traditional database systems and is widely used in various memory storage systems.
[0021] Version control method: maintain version history for memory data, and create a new version each time it is updated. This method is borrowed from source code version control systems (such as Git), and some knowledge graph systems use this method.
[0022] Event trace method: record changes in memory data as an event stream, and reconstruct the state by replaying events. This method is derived from event-driven architecture, and some distributed systems use this design.
[0023] Bi-temporal database method: in the field of relational databases, there is a concept of bi-temporal databases that record fact time and transaction time separately. However, this technology is mainly applied to traditional enterprise databases and has not been adapted to the special needs of agent memory systems.
[0024] However, the above existing technology still has the following defects and deficiencies:
[0025] Defect 1: Unable to distinguish between the time of fact establishment and the time of system record
[0026] The existing technology generally uses a single timestamp to record memory data, which cannot distinguish between the two fundamentally different time concepts of "when the fact is established in the real world" and "when the system learns about the fact", resulting in the inability to meet the requirements of compliance audit for historical state reconstruction.
[0027] Audit backtracking difficulty: When the regulatory agency requires "explain what user information the system relied on when recommending the investment product to the user on June 15, 2024", the system cannot accurately answer. Because only with a single timestamp, it is impossible to determine which information has been known to the system at that time point.
[0028] State reconstruction distortion: A user may inform the system "my risk preference has changed from conservative to aggressive" on June 1, but the system processes the information on June 10. Using a single timestamp will result in a distorted state query result on June 5.
[0029] Responsibility definition ambiguity: When a user complains "the system did not know that I had changed my preference when making recommendations", it is impossible to accurately determine the cognitive state of the system at that time.
[0030] Loss of causality: It is impossible to trace back "which version of user information the system relied on when making a certain decision".
[0031] Technical reasons: The existing technology regards time as one-dimensional, only records the time when data enters the system, and does not establish a two-dimensional time model of fact time and transaction time, lacking a mechanism to distinguish between "when the fact occurs" and "when the system knows".
[0032] Defect 2: State update causes loss of historical information
[0033] The existing technology usually uses in-place update or simple version addition when processing memory data updates, resulting in historical state being overwritten or difficult to accurately locate, and unable to support state reconstruction at any historical time point.
[0034] Loss of historical state: When a user's preference is updated from "conservative" to "aggressive", the system directly overwrites the original record, resulting in the loss of the historical fact that "the user was once conservative".
[0035] Time point query failure: It is impossible to answer "what was the user's investment preference in March 2024" and other point-in-time queries, because the historical state has been overwritten by the new state.
[0036] Preference evolution loss: the evolution track of user preference (e.g. from conservative to moderate to aggressive) cannot be tracked, losing the basis for analyzing user behavior patterns.
[0037] Lack of compliance evidence: when it is necessary to prove that "the system did make recommendations according to the user's preference at that time point", it is impossible to provide a complete evidence chain
[0038] Technical reasons: the existing technology data model design does not consider the time sequence integrity requirement of memory data, and the in-place update mechanism adopted destroys the historical state, even if version control is adopted, there is a lack of precise time positioning ability, and it is impossible to answer the double time sequence query "at a specified time point, what does the system know".
[0039] Defect 3: Lack of complete audit traceability link
[0040] The existing technology lacks a systematic audit mechanism design, and the writing, updating and accessing of memory data lack complete audit logs, which cannot meet the regulatory audit requirements of the financial, medical and other fields.
[0041] Operation is not traceable: it is impossible to trace "who accessed which memory data of the user at what time", and there is a lack of complete data access audit records.
[0042] Decision basis is not explainable: when it is necessary to explain "why did the system make this suggestion", it is impossible to provide the memory context used by the system at that time.
[0043] Data source is not clear: the source of memory data (user actively provides, system infers, external import) cannot be traced back, affecting data credibility evaluation.
[0044] Compliance check is difficult: when the regulatory authorities conduct data audit, the system cannot provide complete data life cycle records, increasing the compliance risk.
[0045] Data subject rights are not adequately protected: data access rights, deletion rights and other data subject rights required by GDPR and other regulations are difficult to effectively protect due to the lack of audit capabilities.
[0046] Technical reasons: the existing technology mainly considers function implementation when designing, and does not systematically design audit as a core requirement, lacks a structured recording mechanism for audit logs, lacks the ability to associate and trace back to memory data, and cannot support the strict requirements of regulatory compliance for audit traceability.
[0047] In view of the defects and deficiencies of the existing technology described above, the present application mainly solves the following technical problems:
[0048] 1. How to accurately distinguish and record fact time and system time: By recording the first time parameter (valid time) and the second time parameter (transaction time) for each piece of memory data, a double time axis model is established to accurately distinguish "when the fact is established" and "when the system knows".
[0049] 2. How to support state reconstruction at any historical time point: Through the double time axis query mechanism, the time point can be specified when querying, and the valid memory data set known by the system at that time point is returned, realizing accurate historical state rollback.
[0050] 3. How to establish a complete audit trace link: Through the systematic audit log mechanism, the complete life cycle of memory data is recorded, including creation, update, access, invalidation and other operations, supporting compliance audit and responsibility trace.
[0051] In view of the problems existing in the prior art, the present application provides an agent memory audit method based on a double time axis, which mainly includes the following four aspects: establishing a double time axis model for memory data, implementing a double time axis query mechanism, building a complete audit trace capability, and supporting historical state rollback and responsibility audit. By recording the first time parameter (valid time) and the second time parameter (transaction time) respectively, the present application realizes time tracking of memory data at the fact level and the system level, solving the problem that the prior art cannot accurately perform historical state rollback and responsibility audit.
[0052] The agent memory audit method based on a double time axis of the present application mainly includes the following core processes: a. recording the first time parameter and the second time parameter for each piece of memory data; b. the first time parameter represents the time range when the memory data is established at the external fact level; c. the second time parameter represents the time when the memory data is recorded or updated by the system; d. when receiving a query request, determining the valid memory data at the corresponding time point according to the first time parameter and the second time parameter; e. generating an audit or query result based on the valid memory data. The query request includes a historical state rollback request; the memory data includes user preferences, state parameters or behavior records; the present application can be applied to financial or compliance audit scenarios.
[0053] The content of the technical solution of the present application will be described in detail below in combination with the drawings and specific embodiments.
[0054] Figure 1 is a flowchart of the agent memory audit method based on a double time axis provided by the embodiments of the present application. As shown in Figure 1 , the agent memory audit method based on a double time axis can specifically include:
[0055] S101, receive memory data associated with a user identifier, and record a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to define a time range in which the memory data is valid in an external fact layer, and the second time parameter is used to define a system record time at which the memory data is written or updated by the system;
[0056] S102, upon receiving an audit request containing a target time point, performing a dual-time axis joint determination on the memory data based on the target time point to determine a set of valid memory data, the dual-time axis joint determination comprising: determining memory data that is within the valid time range at the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter;
[0057] S103, upon receiving new memory data corresponding to a target fact, performing state invalidation update on existing memory data corresponding to the new memory data, the state invalidation update comprising updating the end time of the first time parameter of the existing memory data to the start time of the first time parameter of the new memory data in the same transaction, and writing the new memory data to form a state evolution record;
[0058] S104, generating an audit result based on the set of valid memory data, and recording an audit log corresponding to the audit request, wherein the audit result includes the target time point and memory data identifier and time parameter information corresponding to the set of valid memory data.
[0059] In some embodiments, receiving memory data associated with a user identifier, and recording a first time parameter and a second time parameter for each piece of memory data, comprises:
[0060] Receiving memory content associated with a user identifier, and generating a memory data identifier for the memory content;
[0061] Determining a first time parameter, wherein the first time parameter includes a valid start time and a valid end time, the valid start time being used to represent a time point at which the memory data starts to be valid in an external fact layer, and the valid end time being used to represent a time point at which the memory data stops to be valid in the external fact layer or a preset time point at which the memory data continues to be valid;
[0062] Obtaining time information related to the first time parameter based on the memory content, wherein the obtaining comprises at least one of explicitly providing the time information by an interaction request, extracting the time information from the memory content, and using a current system time as the valid start time when the time information cannot be determined;
[0063] Determining a second time parameter, the second time parameter being a system record time at which the memory data is written or updated by the system, and recording the second time parameter when the memory data is written to storage.
[0064] Specifically, the memory content refers to text generated by user interaction, structured fact description imported by an external system, or preference and state description formed by system inference; the user identifier is used to uniquely identify the data subject to which the memory belongs; the memory data identifier is used to uniquely identify a single piece of memory data and support subsequent associated retrieval. The first time parameter is used to represent the time range in which the memory data is valid at the external fact level, including a valid start time and a valid end time, wherein the valid start time represents the time point at which the fact starts to be valid, and the valid end time represents the time point at which the fact stops to be valid; when the fact is still continuously valid at present, the valid end time is set to a preset time point, and 9999-12-31 can be selected as the preset time point in the embodiment to express continuous validity. The second time parameter is used to represent the system record time when the system writes or updates the memory data, which is used to depict the time point at which the system learns the fact and completes the database storage.
[0065] In specific implementation, after receiving the memory content associated with the user identifier, the system first performs access normalization on the memory content, which includes determining the source type and the memory type of the memory content. The source type is used to distinguish whether the memory content comes from user interaction input, external system import or system inference; the memory type is used to distinguish whether the memory content belongs to user preference, state parameter or behavior record. Subsequently, the system generates the memory data identifier based on the user identifier, the receiving serial number and the time stamp, and establishes a binding relationship between the memory data identifier and the user identifier and the memory content, so as to distinguish and trace multiple memories of the same user in the future.
[0066] For determination of the first time parameter, the embodiment adopts the rule of “explicit provision priority, content extraction supplement, default fallback”. If the fact validity time range is explicitly carried in the interaction request or the import request, the system directly maps it as the valid start time and the valid end time; if it is not explicitly provided, the system performs time information extraction on the memory content, which can include relative time phrase recognition, date expression recognition and time range normalization, wherein the relative time phrase recognition is used to identify expressions such as “last month”, “last week”, “since a certain day” and the like, and convert them into specific dates in combination with the receiving time; the date expression recognition is used to identify expressions such as “2024-06-15” and “6-1” and standardize them; the time range normalization is used to generate the valid end time when the memory content expresses a continuous fact, and set it to a preset time point if the stop validity time cannot be determined.
[0067] If the above extraction still cannot obtain the effective start time, the system takes the current system time as the effective start time and sets the effective end time as a preset time point to ensure the completeness of the first time parameter field. To facilitate audit review, the system can also record the source mark of the first time parameter in the metadata information to indicate that the first time parameter is generated by explicit provision, content extraction or default fallback.
[0068] In some examples, for the determination of the second time parameter, the embodiment automatically records the system time by the storage transaction when the memory data is written or updated. Specifically, the system reads the system clock and generates the second time parameter when writing the memory data containing the user identification, memory data identification, memory content and first time parameter, and writes the second time parameter together with the memory data to the storage to ensure that the second time parameter is consistent with the actual time of falling into the library. For the historical memory imported by the external system, the system allows the system record time of the import to be specified in the controlled import process, while marking the import attribute and import source in the metadata information to distinguish from the automatically recorded time in the online interaction scenario.
[0069] The following illustrates the differential determination process of the first time parameter and the second time parameter in conjunction with examples: In an interaction scenario, the user inputs "I have been interested in stocks since last month", and the system generates the corresponding memory data identification after receiving the memory content, and performs time information extraction on "since last month", determines the effective start time as the starting date of last month or the corresponding date, and sets the effective end time as a preset time point to represent continuous validity; At the same time, the system records the system record time as the second time parameter when the writing is completed.
[0070] For example, the user informs a fact on June 1, 2024, but due to asynchronous processing or queue backlog, the system completes the writing on June 2, 2024, then the first time parameter can be determined as valid since June 1, 2024, according to the fact expression, while the second time parameter records the system record time of June 2, 2024, to reflect the time when the system actually learns and registers the fact.
[0071] Further, when the user preference changes, for example, the user forms a memory data of "risk preference is conservative" on June 1, 2024, and then forms a new memory data of "risk preference is aggressive" on June 15, 2024, the system can update the effective end time of the old memory data to June 15, 2024 when writing the new memory data, so that the establishment time range of the old memory data in the external fact level is truncated, while the effective start time of the new memory data is June 15, 2024 and the effective end time is a preset time point, and the two memory data records the respective system record time, thereby providing continuous and non-overlapping effective time boundaries for subsequent joint determination according to the target time point.
[0072] Through the processing mode of the above-mentioned embodiments, the system establishes the double-time parameters of the external fact establishment time range and the system recording time for each piece of memory data in the writing stage, and forms a traceable time information source mark, so that subsequent accurate screening of the memory data set "external fact established at the time point and recorded by the system" based on the target time point can be performed, time semantic confusion is reduced, and the consistency of historical state backtracking and audit evidence is improved.
[0073] In some embodiments, upon receiving an audit request containing a target time point, a double-time axis joint determination is performed on the memory data based on the target time point to determine the effective memory data set, including:
[0074] Obtaining the target time point and the user identifier associated with the target time point from the audit request;
[0075] Filtering candidate memory data from the memory data based on the user identifier, and filtering memory data with a second time parameter not later than the target time point from the candidate memory data to obtain a target candidate set;
[0076] For the target candidate set, performing time range determination according to the first time parameter to determine memory data satisfying the effective start time not later than the target time point and the effective end time later than the target time point as the effective memory data set.
[0077] Specifically, the audit request refers to a query request for historical state backtracking or responsibility audit, which at least includes a user identifier and a target time point. The target time point is used to represent the historical moment to be backtracked for audit, and the user identifier is used to limit the data subject corresponding to the audit range. The memory data is a historical memory record associated with the user identifier, and each piece of memory data at least contains a first time parameter and a second time parameter, wherein the first time parameter contains an effective start time and an effective end time, which are used to limit the time range of the establishment of the memory data at the external fact level; the second time parameter is a system recording time, which is used to limit the time when the system writes or updates the memory data.
[0078] In specific implementation, after the system receives the audit request, it first parses the audit request to obtain the target time point and the user identifier associated with the target time point. The parsing process can include standardizing the time field in the request payload to unify the time precision and time zone caliber, and performing legality verification and access permission verification on the user identifier to ensure that subsequent queries are only performed within the authorized user range.
[0079] Subsequently, the system enters a candidate memory data screening phase. This phase takes the user identification as the retrieval key, reads the memory data associated with this user identification from the memory data store as candidate memory data, and performs the first round of filtering based on the second time parameter. Specifically, the system screens the candidate memory data for memory data whose second time parameter is no later than the target time point to obtain a target candidate set. This screening is used to ensure that only memory data that the system has completed writing or updating before the target time point can enter the audit view, thereby explicitly incorporating the condition of “whether the system is aware” into the decision.
[0080] The significance of the second time parameter screening is illustrated below in conjunction with an example: in a scenario, a user informs the system on June 1, 2024 that “my risk preference is conservative”, but the system writes this due to asynchronous processing on June 2, 2024, so the effective start time of this memory data can be June 1, 2024, while the system record time is June 2, 2024. When the target time point of the audit request is June 1, 2024, the system can directly exclude this memory data based on the second time parameter screening, so that the audit result reflects the cognitive state of “the system has not written and completed registration at this time on June 1, 2024”; when the target time point is June 10, 2024, this memory data satisfies the condition of the second time parameter being no later than the target time point, so it enters the target candidate set, providing input for the second phase of the joint decision.
[0081] After obtaining the target candidate set, the system enters a time range determination phase based on the first time parameter. This phase performs time range matching for each piece of memory data in the target candidate set to determine memory data that is true at the external fact level outside the target time point. Specifically, the system determines whether the effective start time of each piece of memory data is no later than the target time point and whether its effective end time is later than the target time point; memory data that satisfies the above conditions is confirmed as memory data that is in the established time range at the target time point and is included in the valid memory data set. This time range determination embodies the condition of “whether the fact is true at this time point”, so even if the system has recorded a piece of memory data, it also needs to be in the valid interval at the external fact level at the target time point to enter the valid memory data set.
[0082] The execution process of the first time parameter determination is illustrated below in conjunction with an example about preference evolution: the system forms a memory data of “risk preference is conservative” on June 1, 2024, whose effective start time is June 1, 2024, and whose effective end time is updated to June 15, 2024 when the preference is changed later; the system forms a new memory data of “risk preference is aggressive” on June 15, 2024, whose effective start time is June 15, 2024, and whose effective end time is a preset time point.
[0083] For the audit request with the target time point of June 10, 2024, the system can obtain two candidate records that have been written by the system after the second time parameter screening, and further determine based on the first time parameter, wherein the "conservative" record satisfies the condition that the valid start time is not later than June 10, 2024 and the valid end time is later than June 10, 2024, so as to be included in the valid memory data set, and the "aggressive" record is excluded because the valid start time is June 15, 2024, which does not satisfy the condition that the valid start time is not later than the target time point. For the audit request with the target time point of June 20, 2024, the system includes the "aggressive" record in the valid memory data set and excludes the "conservative" record, so that the valid memory data set has uniqueness and consistency on the time axis.
[0084] In actual engineering implementation, in order to ensure that the joint determination result can be used for subsequent audit result generation and review, the system can record the determination basis information when forming the valid memory data set, the determination basis information at least including the target time point participating in the determination, the second time parameter condition adopted in candidate screening, the first time parameter condition adopted in time range determination, and the memory data identifier set included in the valid memory data set, so that the audit context can be formed by directly quoting the above determination basis information when generating the audit result subsequently.
[0085] Through the embodiment, after receiving the audit request, the system first limits the memory data range of "recorded by the system before the target time point" based on the second time parameter, and then limits the memory data range of "the fact outside the target time point is true" based on the first time parameter, to form the valid memory data set of the double time axis joint determination, thereby improving the accuracy and consistency of the system cognitive state reconstruction at the historical time point, and providing reviewable memory data basis for the generation of subsequent audit results.
[0086] In some embodiments, the method further comprises:
[0087] When the audit request carries the indication information including the invalid memory data, the memory data with the valid end time of the first time parameter not later than the target time point and the second time parameter not later than the target time point is included in the valid memory data set or included in the supplementary memory data set associated with the valid memory data set; the valid memory data set is sorted according to the second time parameter, and the sorted valid memory data set is output for generating the audit result.
[0088] Specifically, the audit request can carry indication information containing the invalid memory data in addition to the user identifier and the target time point. The indication information is used to indicate whether the auditor requires the invalid memory data before the target time point to be included in the audit scope when generating the audit result. The invalid memory data refers to the memory data whose establishment time range defined by the first time parameter does not cover the target time point, typically represented by its effective end time not later than the target time point. Correspondingly, the valid memory data set is still determined according to the aforementioned joint determination rule, that is, the joint conditions of the effective start time not later than the target time point, the effective end time later than the target time point, and the second time parameter not later than the target time point.
[0089] In a specific implementation, after the system completes the determination of the valid memory data set, it analyzes the indication information in the audit request to determine whether the invalid memory data needs to be introduced. If the indication information indicates that the invalid memory data needs to be included, the system further screens the memory data meeting the following conditions from the memory data associated with the user identifier as the incorporation object based on the target time point: the effective end time of the first time parameter of the memory data not later than the target time point, and the second time parameter not later than the target time point.
[0090] The meaning of the above conditions is that the memory data has stopped establishing before the target time point in the external fact level, and at the same time, the memory data has been written or updated before the target time point in the system level and can be traced back. The system incorporates the screened memory data into the valid memory data set or the supplementary memory data set associated with the valid memory data set.
[0091] Among them, "incorporate into the valid memory data set" is applicable to the scenario where the audit output needs to carry all memory contexts in a single set; "incorporate into the supplementary memory data set" is applicable to the scenario where the audit output needs to distinguish between "memory data established at the target time point" and "memory data invalidated before the target time point but needed for tracing back". In the latter scenario, the system maintains the association between the supplementary memory data set and the valid memory data set when storing or outputting. The association can be bound based on the audit identifier, the user identifier, and the target time point, so that the audit result can refer to both sets without confusing the determination criteria.
[0092] The necessity of supplementary incorporation is illustrated by combining the preference evolution example: the user forms the memory data of "risk preference is conservative" on June 1, 2024, and forms the new memory data of "risk preference is aggressive" on June 15, 2024, and the system updates the valid end time of the "conservative" memory data to June 15, 2024 when the state fails to update. When the target time point of the audit request is June 20, 2024, according to the joint determination rule of the double time axis, the valid memory data set contains the "aggressive" memory data and does not contain the "conservative" memory data. However, in some audit scenarios, the audit party may require to view the preference evolution information before the target time point at the same time to check whether the time boundary of the preference change is consistent with the system suggestion process, at this time the audit request carries the indication information containing the invalid memory data, the system incorporates the "conservative" memory data into the supplementary memory data set as the invalid memory data, so that the audit result can present the state trajectory before the target time point without changing the validity of the target time point.
[0093] The restriction of the second time parameter condition is illustrated by combining the foregoing asynchronous writing example: if a piece of memory data has stopped existing before the target time point on the external fact level, but the system completes the writing after the target time point, the second time parameter of the memory data is later than the target time point, which does not meet the incorporation condition, and the system will not incorporate the memory data into the supplementary range, thereby avoiding the case that the information recorded by the system after the target time point is mistakenly included in the target time point audit context.
[0094] After completing the incorporation processing, the system sorts the valid memory data set according to the second time parameter, and outputs the sorted valid memory data set for generating the audit result. The sorting rule takes the second time parameter as the main sorting key, and preferentially outputs the memory data recorded by the system at a later time, so that the audit result can reflect the order in which the system learns the information when presenting the memory context. For the scene where the supplementary memory data set exists, the system can execute the same sorting rule on the valid memory data set and the supplementary memory data set respectively, and maintain the association between the two sets and the audit identifier when outputting, so that the "memory data sequence established at the target time point" and the "memory data sequence invalidated before the target time point" can be referred to respectively when generating the audit result subsequently.
[0095] Through the embodiment, when the audit request requires to include the invalid memory data, the system extends the audit context under the constraint of the target time point with the valid end time of the first time parameter and the system recording time of the second time parameter as the screening condition, and outputs the valid memory data set through the unified sorting rule based on the second time parameter, so that the audit result can not only maintain the consistency of the determination of the valid memory data at the target time point, but also provide traceable historical evolution information under controlled scope, and improve the operability of the audit context organization and review.
[0096] In some embodiments, upon receiving new memory data corresponding to a target fact, performing state invalidation update on existing memory data corresponding to the new memory data, comprising:
[0097] receiving new memory data, and determining a target fact corresponding to the new memory data based on memory content and metadata information of the new memory data;
[0098] determining existing memory data corresponding to the target fact in memory data associated with the user identifier based on the target fact;
[0099] determining a valid start time in a first time parameter of the new memory data;
[0100] updating a valid end time in the first time parameter of the existing memory data to the valid start time in the same transaction, and writing the new memory data containing the first time parameter and a second time parameter into storage, wherein the second time parameter is a system record time when the system writes or updates the new memory data;
[0101] storing the updated existing memory data and the written new memory data in association to form a state evolution record.
[0102] Specifically, the new memory data refers to a memory record newly received by the system and to be written, which at least contains a user identifier, memory content, a first time parameter, and metadata information for describing source type, memory type, fact name identifier, attribute information, etc. The target fact is used to represent a fact object or fact dimension described by the new memory data, such as a risk preference dimension in user preference, a retirement target dimension in state parameter, or a transaction action dimension in behavior record, etc. The existing memory data refers to a memory record corresponding to the target fact and previously written into storage in memory data associated with the user identifier. The first time parameter includes a valid start time and a valid end time, which are used to limit the time range when the external fact level is established. The second time parameter is a system record time when the system writes or updates the memory data, which is used to depict the time point registered on the system side.
[0103] In a specific implementation, after receiving the new memory data, the system first determines the target fact of the new memory data. The target fact determination is not based on only the text comparison of the memory content, but also combines the memory content and the metadata information to form a stable fact positioning basis. Specifically, the system reads the memory type identifier and the fact name identifier from the metadata information, the memory type identifier is used to indicate that the new memory data belongs to one of the user preferences, state parameters or behavior records, and the fact name identifier is used to indicate the fact dimension name of the memory data under the corresponding type; the system then generates a fact matching condition in combination with the key attribute information in the memory content, so that the same target fact can be consistently positioned when searching the existing memory data in the subsequent.
[0104] Further, after completing the target fact determination, the system determines the existing memory data based on the target fact in the memory data associated with the user identifier. In this embodiment, the system obtains a candidate existing set with the user identifier as the search key, and filters out the candidate existing records corresponding to the target fact based on the fact matching condition; when there are multiple candidate existing records, the system can further lock the existing memory data in combination with the first time parameter and the second time parameter, for example, preferentially selecting the candidate record within the established time range at the valid start time of the new memory data, and selecting the record with the latest system record time as the existing memory data when there are still multiple records, to ensure that the connection relationship between the invalidated record and the new record on the external fact timeline is clear.
[0105] Further, after determining the existing memory data, the system obtains the valid start time in the first time parameter of the new memory data. The determination method of the valid start time is consistent with the aforementioned "double time parameter acquisition" embodiment, which can be provided explicitly from the interaction request, extracted from the memory content, or adopted as the current system time when it cannot be determined. This embodiment emphasizes that the boundary time adopted by the state invalidation update is based on the valid start time of the new memory data, rather than the system write time, thereby ensuring the semantic consistency of the first time parameter reflecting the established time range of the external fact level.
[0106] Subsequently, the system performs the state invalidation update and the write operation in the same transaction. Illustratively, after starting the transaction, the system first updates the valid end time in the first time parameter of the existing memory data to the above-mentioned valid start time, so that the established time range of the existing memory data on the external fact level is truncated; then writes the new memory data containing the first time parameter and the second time parameter into the storage, wherein the second time parameter is automatically recorded as the system record time by the system at the time of writing. Updating the valid end time of the existing record and writing the new record are completed in the same transaction, which can avoid the intermediate inconsistent state that only the existing record is updated but the new record is not written, or the new record is written but the existing record is not truncated, so that the state evolution boundary is consistent at the storage level.
[0107] The above process is explained below in conjunction with a specific example: on June 1, 2024, the user forms a memory data of "risk preference is conservative", the system records the system record time and determines the effective start time as June 1, 2024 and the effective end time as a preset time point; on June 15, 2024, the user again expresses "I want to be a little aggressive now", after the system receives the new memory data, it determines the target fact as the preference dimension of "risk preference" through the memory type identifier and the fact name identifier, and locates the existing "conservative" record in the memory data associated with the user identifier; the system determines the effective start time of the new memory data as after June 15, 2024, updates the effective end time of the existing "conservative" record as June 15, 2024 in the same transaction, and writes a new "aggressive" record, and adds the system record time to the new record. Through the processing, the existing record and the new record form a continuous and non-overlapping established interval on the external fact timeline, providing clear boundaries for subsequent double-time-axis joint determination with June 10, 2024 or June 20, 2024 as the target time point.
[0108] After the transaction is submitted, the system stores the updated existing memory data and the written new memory data in association to form a state evolution record. The association can be achieved by writing the memory data identifier of each other in the metadata information of the two memory data, writing the same state evolution link identifier, or writing the predecessor and successor relationship marker, so that in subsequent audits, the corresponding existing record of the new record can be traced back, and further historical records can be traced back to form a complete evolution sequence. For the scene where the audit request carries indication information containing invalid memory data, the system can quickly retrieve the historical link record corresponding to the target fact according to the above association relationship, and organize it into a supplementary memory data set according to the second time parameter or the effective time boundary.
[0109] Through the embodiment, when the system receives the new memory data corresponding to the target fact, it locks the existing memory data based on the target fact, uses the effective start time of the new memory data as the dividing point of the external fact timeline, updates the effective end time of the existing record and writes the new record in the same transaction, and establishes the association storage relationship between the two, so as to form a continuously traceable state evolution record without covering historical records, and improve the reviewability and consistency of state boundaries and evolution links in subsequent historical state backtracking and audit evidence.
[0110] In some embodiments, the target fact corresponding to the new memory data is determined based on the memory content and metadata information of the new memory data, and the existing memory data corresponding to the target fact is determined in the memory data associated with the user identifier based on the target fact, including:
[0111] The memory type identifier is used to indicate that the new memory data belongs to one of the user preference, the state parameter or the behavior record.
[0112] The fact matching condition is generated based on the memory type identifier, the fact name identifier and the attribute information.
[0113] The memory data satisfying the fact matching condition is retrieved from the memory data associated with the user identifier as a candidate existing set.
[0114] In the candidate existing set, the existing memory data whose effective start time of the first time parameter of the new memory data is within the established time range is determined as the existing memory data based on the first time parameter.
[0115] When there are multiple existing memory data satisfying the condition, the existing memory data with the largest second time parameter is determined as the existing memory data based on the second time parameter.
[0116] Specifically, the new memory data contains not only the user identifier and the memory content, but also the metadata information for assisting classification and retrieval. The metadata information at least includes the memory type identifier, the fact name identifier and the attribute information associated with the memory content. The memory type identifier is used to indicate that the new memory data belongs to one of the user preference, the state parameter or the behavior record, so as to distinguish the matching granularity of different memory types in semantics; the fact name identifier is used to indicate the fact dimension name described by the memory data, for example, in the user preference type memory, it is used to identify the "risk preference" preference dimension, in the state parameter type memory, it is used to identify the "retirement target" state dimension, and in the behavior record type memory, it is used to identify the "asset portfolio adjustment" event dimension; and the attribute information is used to describe the key attribute set under the fact dimension, for example, the level attribute of risk preference, the target year attribute of the state parameter, the action type and target attribute of the behavior record, etc.
[0117] In the specific implementation, after receiving the new memory data, the system first acquires the memory type identifier, the fact name identifier and the attribute information from the new memory data, and generates the fact matching condition based on the above information. The fact matching condition is used to constrain the retrieval range of the existing memory data, which at least includes: a group of type conditions for limiting the memory type, a group of name conditions for limiting the target fact dimension, and attribute constraint conditions for limiting the same fact object.
[0118] The construction of the attribute constraint condition can be related to the memory type: for the user preference type and the state parameter type memory, the attribute constraint condition can be used to limit the key value set of the same preference item or the same state item; for the behavior record type memory, the attribute constraint condition can be used to limit the key field related to the same behavior category or the same event identification. In order to ensure the consistency of the terms and the auditability, the system can record the generation basis of the fact matching condition in the metadata information, which is used to identify that the condition is generated by direct mapping of the fact name identification, by combination of the attribute information, or by both.
[0119] Further, after the generation of the fact matching condition is completed, the system performs retrieval in the memory data associated with the user identification based on the user identification to obtain a candidate existing set. In some examples, the system limits the user range with the user identification as the main retrieval key, and filters the memory data within the range using the fact matching condition, so that the candidate existing set only contains the historical records related to the target fact that the new memory data may correspond to. Each piece of memory data in the candidate existing set still carries its first time parameter and second time parameter, so as to be further located subsequently.
[0120] In the candidate existing set, the system further determines the existing memory data based on the first time parameter. This step takes the valid start time in the first time parameter of the new memory data as the time reference, and determines whether the establishment time range of the memory data in the candidate existing set covers the valid start time. Specifically, the system determines whether the valid start time of the candidate existing memory data is not later than the valid start time, and determines whether the valid end time is later than the valid start time. The candidate existing memory data that meets the above conditions is confirmed as the existing memory data. This processing is used to ensure that the selected existing memory data is still in the established state at the moment when the new fact is established on the external fact level, so that the subsequent updating of its valid end time to the valid start time of the new fact has time semantic consistency.
[0121] If there are multiple candidate existing memory data that meet the above establishment time range condition, the system further determines the one with the largest second time parameter as the existing memory data based on the second time parameter. This selection rule is used to preferentially select the one with the latest system recording time as the existing record to be invalidated in the case of multiple write or update records of the same target fact, so as to ensure that the front and back links of the state evolution are consistent with the registration sequence on the system side.
[0122] The above positioning process is described below in combination with a specific example: in a user preference type memory scenario, a user forms memory data of "risk preference is conservative" on June 1, 2024, and subsequently forms new memory data of "risk preference is aggressive" on June 15, 2024. After the system receives the new memory data, it obtains the memory type identifier as user preference, the fact name identifier as risk preference from the metadata information, and the attribute information such as risk level from the memory content, generates a fact matching condition to limit the historical records under the same user preference type and the same risk preference dimension. The system retrieves the candidate existing set containing the "conservative" record based on the user identifier associated with the memory data.
[0123] Subsequently, the system takes the effective start time of the new memory data, June 15, 2024, as the reference, and determines that the establishment time range of the "conservative" record covers the reference time point based on the first time parameter, so as to take it as the existing memory data; if there are multiple risk preference related records in the candidate existing set, the system further compares their system record times and selects the one with the latest system record time as the existing memory data, and then enters the effective end time update and new record writing process within the same transaction.
[0124] Further combined with an asynchronous writing example: a user informs a fact on June 1, 2024, but the system writes it on June 2, 2024, resulting in multiple records with different system record times for the same fact dimension in the candidate existing set. At this time, the system can avoid selecting records with earlier system record times that may have been overwritten by subsequent writing through the second time parameter maximum selection rule, so as to make the positioning of the existing memory data consistent with the object of the subsequent state invalidation update.
[0125] Through this embodiment, after receiving the new memory data, the system constructs a fact matching condition based on the memory type identifier, the fact name identifier, and the attribute information, positions the candidate existing set within the user range, and further selects the existing record covering the establishment time range based on the effective start time of the new memory data as the reference through the first time parameter, and if necessary, resolves the ambiguity of multiple candidates through the second time parameter maximum rule, so as to improve the accuracy and consistency of the positioning of the existing memory data, and provide stable fact anchors and reviewable basis for the construction of subsequent state invalidation update and state evolution record.
[0126] In some embodiments, an audit result is generated based on the effective memory data set, and an audit log corresponding to the audit request is recorded, including:
[0127] An audit identifier is generated based on the audit request, and the user identifier, target time point, and decision task identifier associated with the audit request in the audit request are obtained;
[0128] The effective memory data set is encapsulated as audit context data, and the audit context data includes memory data identifiers, memory content, and corresponding first and second time parameters;
[0129] The audit result is generated based on the audit context data, and the audit result includes an audit identifier, a user identifier, a target time point, and the audit context data;
[0130] An audit log associated with the audit identifier is generated, and the audit log includes a user identifier, an operation type, a resource type, a resource identifier, an operation time parameter, and access context information, wherein the access context information includes at least one of access address information, access terminal information, and jurisdictional area information;
[0131] The audit result is stored in association with the audit log for performing audit queries based on the audit identifier.
[0132] Specifically, after receiving the audit request and completing the effective memory data set determination, the system first generates an audit identifier based on the audit request. The audit identifier is used to uniquely identify a one-time audit task or a one-time historical state snapshot request, which can be generated by combining a user identifier, a target time point, a request sequence number, and a generation time, and can be globally unique within the same user range.
[0133] At the same time, the system obtains the user identifier and the target time point from the audit request, and obtains the decision task identifier associated with the audit request. The decision task identifier is used to identify a specific business decision process or suggestion generation process corresponding to the audit request, for example, in a financial consultant scenario, it is used to identify a certain investment suggestion generation task; the decision task identifier can be carried by the upper intelligent agent system when initiating the audit request, or it can be obtained by mapping the decision process identifier recorded before the audit request is triggered, so as to ensure that the audit result can be associated with a specific decision link.
[0134] Subsequently, the system encapsulates the valid memory data set as audit context data. The encapsulation process is not simply a copy of the list, but organizes each piece of memory data in the valid memory data set according to a unified field criterion, so that it can be directly referenced during audit review. Exemplarily, the audit context data at least includes each memory data identifier, memory content, and corresponding first and second time parameters. The first time parameter is used to present the time range in which the memory data is valid in the external fact layer, and the second time parameter is used to present the system record time when the system writes or updates the memory data, so that the audit context has a reviewable anchor point for both the fact timeline and the system cognitive timeline. For the scenario where the audit request carries indication information containing invalid memory data, the system can also distinguish the valid memory data set and the supplementary memory data set in the audit context data with independent markers, and preserve the sorting results of the memory data in each set, to avoid confusion of the set criterion during subsequent audit queries.
[0135] Further, after completing the encapsulation of the audit context data, the system generates an audit result based on the audit context data. The audit result at least includes an audit identifier, a user identifier, a target time point, and the audit context data. To enhance the relevance of the audit result and the decision link, the audit result can also record a decision task identifier, so that subsequent can locate the corresponding audit identifier according to the decision task identifier, or trace back the decision task to which this audit is directed according to the audit identifier. Through this structured result, the auditor can directly view the memory context available for decision at that time under the specified target time point, and can further locate the storage record of the corresponding memory data according to the memory data identifier.
[0136] At the same time of generating the audit result, the system generates an audit log associated with the audit identifier. The audit log is used to record the access behavior and operation context of this audit request, which at least includes a user identifier, an operation type, a resource type, a resource identifier, an operation time parameter, and access context information. The operation type is used to represent that this behavior belongs to one of reading, searching, snapshot, or audit query; the resource type is used to represent that the accessed object belongs to one of memory data, user profile, or time sequence snapshot; the resource identifier at least includes the accessed audit identifier or the memory data set identifier corresponding to the searched user identifier; and the operation time parameter is the record time of the audit log.
[0137] In some examples, the access context information at least includes at least one of access address information, access terminal information, and jurisdiction area information, wherein the access address information is used to identify an access source network location, the access terminal information is used to identify a terminal type or a terminal identifier of a request initiator, and the jurisdiction area information is used to identify a compliance area criterion applicable to the current access. To ensure subsequent audit review, the system can also record summary information of the target time point and the decision task identifier and other key request parameters in the audit log, so that the audit log can quickly locate the corresponding audit result without expanding the entire context.
[0138] The following describes the association output mode of the audit result and the audit log in combination with specific examples: in the scenario where the user preference changes, the user forms the memory data of "risk preference conservative" on June 1, 2024, and forms the new memory data of "risk preference aggressive" on June 15, 2024. After receiving the audit request for the target time point of June 10, 2024, the system obtains the valid memory data set as the "conservative" record through the joint determination of the double time axis, generates an audit identifier, encapsulates the set as audit context data, and forms an audit result; at the same time, the system records the audit identifier, the operation type as snapshot or audit query, the resource type as memory data snapshot, the operation time parameter as the current system recording time, and records the access context information such as the access terminal and the jurisdiction area in the audit log.
[0139] If the subsequent supervisor requires review of "which memories did the system make recommendations based on on June 20, 2024", the system can generate a new audit identifier and form the corresponding audit result again, and through the audit log, the access source and operation link of the two audit requests can be distinguished, thereby supporting the parallel management of multiple audit tasks. For example, in the asynchronous writing scenario, the user informs a fact on June 1, 2024, but the system writes it on June 2, 2024. When the target time point of the audit request is June 1, 2024, the audit context data will not include the memory data; the audit result still records the double time parameters of the target time point and the context set, so that the audit party can review the reason why the memory data is not included, and can locate the specific query link of the audit request through the audit log.
[0140] Further, after generating the audit result and the audit log, the system stores them in association. The association storage takes the audit identifier as the main association key, binds the audit result object and the audit log record under the same audit entity, and writes into a storage structure supporting audit query. When receiving an audit query request based on the audit identifier, the system can directly return the audit result corresponding to the audit identifier, and at the same time return or retrieve its associated audit log on demand, so that the audit party can complete "audit context review" and "access behavior review" under the same audit identifier.
[0141] Through the embodiment, the system encapsulates the effective memory data set as audit context data containing double time parameters and generates an audit result after determining the effective memory data set, taking the audit identifier as the association main line, generates an audit log containing the operation type, resource identifier and access context information, and stores the audit result and the audit log in association, thereby improving the traceability of the audit request and the structured degree of the audit material, and facilitating subsequent audit query and responsibility review based on the target time point and the audit identifier.
[0142] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, refer to the method embodiments of the present application.
[0143] Figure 2 is a structural schematic diagram of an agent memory audit apparatus based on double time axes provided by an embodiment of the present application. As shown in Figure 2 The agent memory audit apparatus based on double time axes includes:
[0144] The receiving module 201 is configured to receive memory data associated with a user identifier, and record a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to define a time range in which the memory data is valid in an external fact level, and the second time parameter is used to define a system record time at which the memory data is written or updated by the system;
[0145] The determining module 202 is configured to, when an audit request containing a target time point is received, perform double time axis joint determination on the memory data based on the target time point to determine a set of effective memory data, wherein the double time axis joint determination includes determining memory data that is within the valid time range at the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter;
[0146] The updating module 203 is configured to, when new memory data corresponding to a target fact is received, perform state invalidation update on existing memory data corresponding to the new memory data, wherein the state invalidation update includes updating the end time of the first time parameter of the existing memory data to the start time of the first time parameter of the new memory data in the same transaction, and writing the new memory data to form a state evolution record;
[0147] The generating module 204 is configured to generate an audit result based on the set of effective memory data, and record an audit log corresponding to the audit request, wherein the audit result includes the target time point and memory data identifier and time parameter information corresponding to the set of effective memory data.
[0148] In some examples, Figure 2The receiving module 201 receives the memory content associated with the user identifier, and generates a memory data identifier for the memory content; determines a first time parameter, wherein the first time parameter includes an effective start time and an effective end time, the effective start time is used to represent a time point at which the memory data is established at an external fact level, and the effective end time is used to represent a time point at which the memory data stops being established at the external fact level or a preset time point at which the memory data continues to be established; obtains time information related to the first time parameter based on the memory content, wherein the obtaining includes at least one of explicitly providing the time information by the interaction request, extracting the time information from the memory content, and using a current system time as the effective start time when the time information cannot be determined; determines a second time parameter, which is a system record time at which the memory data is written or updated by the system, and records the second time parameter when the memory data is written into the storage.
[0149] In some examples, Figure 2 The determination module 202 obtains a target time point and a user identifier associated with the target time point from the audit request; filters candidate memory data from the memory data based on the user identifier, and filters memory data with a second time parameter not later than the target time point from the candidate memory data to obtain a target candidate set; for the target candidate set, performs time range determination according to the first time parameter, and determines memory data satisfying the effective start time not later than the target time point and the effective end time later than the target time point as an effective memory data set.
[0150] In some examples, Figure 2 The determination module 202, when the audit request carries indication information containing the invalid memory data, incorporates memory data with the effective end time of the first time parameter not later than the target time point and the second time parameter not later than the target time point into the effective memory data set or into a supplementary memory data set associated with the effective memory data set; sorts the effective memory data set according to the second time parameter, and outputs the sorted effective memory data set for generating an audit result.
[0151] In some examples, Figure 2The updating module 203 receives the new memory data, and determines a target fact corresponding to the new memory data based on memory content and metadata information of the new memory data; determines existing memory data corresponding to the target fact in memory data associated with the user identifier based on the target fact; determines an effective start time in the first time parameter of the new memory data; in the same transaction, updates the effective end time in the first time parameter of the existing memory data to the effective start time, and writes the new memory data containing the first time parameter and the second time parameter into the storage, where the second time parameter is a system record time when the system writes or updates the new memory data; and stores the updated existing memory data and the written new memory data in association to form a state evolution record.
[0152] In some examples, Figure 2 The updating module 203 obtains a memory type identifier, a fact name identifier, and attribute information associated with the memory content from the new memory data, where the memory type identifier is used to indicate that the new memory data belongs to one of user preferences, state parameters, or behavior records; generates a fact matching condition based on the memory type identifier, the fact name identifier, and the attribute information; retrieves memory data satisfying the fact matching condition in memory data associated with the user identifier as a candidate existing set; in the candidate existing set, determines existing memory data in which the effective start time in the first time parameter of the new memory data is within the valid time range as the existing memory data based on the first time parameter; and when there are multiple existing memory data satisfying the condition, determines the existing memory data with the largest second time parameter as the existing memory data based on the second time parameter.
[0153] In some examples, Figure 2 The generating module 204 generates an audit identifier based on the audit request, and obtains a user identifier, a target time point, and a decision task identifier associated with the audit request in the audit request; encapsulates the effective memory data set as audit context data, where the audit context data includes memory data identifiers, memory content, and corresponding first time parameters and second time parameters; generates an audit result based on the audit context data, where the audit result includes the audit identifier, the user identifier, the target time point, and the audit context data; generates an audit log associated with the audit identifier, where the audit log includes the user identifier, the operation type, the resource type, the resource identifier, the operation time parameter, and access context information, and the access context information includes at least one of access address information, access terminal information, and jurisdictional area information; and stores the audit result and the audit log in association for performing audit query based on the audit identifier.
[0154] Figure 3 is a schematic diagram of an electronic device 3 provided by an embodiment of the present application. As shown in Figure 3As shown, the electronic device 3 of this embodiment includes a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. The processor 301 implements the steps in each of the above method embodiments when executing the computer program 303. Alternatively, the processor 301 implements the functions of each module / unit in each of the above apparatus embodiments when executing the computer program 303.
[0155] The electronic device 3 can be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 3 can include but is not limited to the processor 301 and the memory 302. Those skilled in the art can understand that the electronic device 3 can include more or less components, or different components than those shown. Figure 3 The electronic device 3 shown is merely an example and does not constitute a limitation on the electronic device 3, which can include more or less components, or different components than those shown.
[0156] The processor 301 can be a central processing unit (CPU), or other general purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or the like.
[0157] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or a memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, or the like. The memory 302 can also include both an internal storage unit and an external storage device of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0159] If the integrated module / unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (for example, a computer readable storage medium). Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program can include computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable storage medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier wave signal, telecommunication signal and software distribution medium, etc.
[0160] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for auditing the memory of an intelligent agent based on dual time axes, characterized in that, include: Receive memory data associated with a user identifier, and record a first time parameter and a second time parameter for each piece of memory data, wherein the first time parameter is used to limit the time range in which the memory data is valid at the external fact level, and the second time parameter is used to limit the system record time when the memory data is written or updated by the system. Upon receiving an audit request containing a target time point, a dual-timeline joint determination is performed on the memory data based on the target time point to determine the set of valid memory data. The dual-timeline joint determination includes: determining memory data within the establishment time range of the target time point based on the first time parameter, and determining memory data that has been written or updated by the system before the target time point based on the second time parameter. When new memory data corresponding to the target fact is received, a state invalidation update is performed on the existing memory data corresponding to the new memory data. The state invalidation update includes updating the end time of the first time parameter of the existing memory data to the start time of the first time parameter of the new memory data in the same transaction, and writing the new memory data to form a state evolution record. An audit result is generated based on the valid memory data set, and an audit log corresponding to the audit request is recorded. The audit result includes the target time point and the memory data identifier and time parameter information corresponding to the valid memory data set.
2. The method according to claim 1, characterized in that, The process of receiving memory data associated with a user identifier and recording a first time parameter and a second time parameter for each piece of memory data includes: Receive memory content associated with the user identifier, and generate a memory data identifier for the memory content; The first time parameter is determined, wherein the first time parameter includes an effective start time and an effective end time. The effective start time is used to characterize the time point at which the memory data begins to be established at the level of external facts, and the effective end time is used to characterize the time point at which the memory data stops being established at the level of external facts or to characterize a preset time point at which the memory data continues to be established. Based on the memory content, time information related to the first time parameter is obtained, wherein obtaining includes at least one of the following: explicitly providing time information by an interactive request, extracting time information from the memory content, and using the current system time as the valid start time when the time information cannot be determined; The second time parameter is determined, which is the system record time when the system writes or updates the memory data, and the second time parameter is recorded when the memory data is written to storage.
3. The method according to claim 1, characterized in that, Upon receiving an audit request containing a target time point, the step of performing a dual-timeline joint determination based on the target time point and the memory data to determine the valid memory data set includes: Obtain the target time point and the user identifier associated with the target time point from the audit request; Based on the user identifier, candidate memory data is filtered from the memory data, and memory data with a second time parameter no later than the target time point is filtered from the candidate memory data to obtain a target candidate set; For the target candidate set, a time range determination is performed based on the first time parameter to determine the memory data that satisfies the condition that the effective start time is not later than the target time point and the effective end time is later than the target time point, which is then used as the effective memory data set.
4. The method according to claim 3, characterized in that, The method further includes: When the audit request carries indication information containing expired memory data, memory data whose effective end time of the first time parameter is not later than the target time point and whose second time parameter is not later than the target time point are incorporated into the effective memory data set or into a supplementary memory data set associated with the effective memory data set; the effective memory data set is sorted according to the second time parameter, and the sorted effective memory data set is output to generate the audit result.
5. The method according to claim 1, characterized in that, Upon receiving new memory data corresponding to the target fact, the step of updating the state of existing memory data corresponding to the new memory data includes: Receive the new memory data, and determine the target fact corresponding to the new memory data based on the memory content and metadata information of the new memory data; Based on the target fact, determine the existing memory data corresponding to the target fact in the memory data associated with the user identifier; Determine the valid start time in the first time parameter of the new memory data; In the same transaction, the valid end time in the first time parameter of the existing memory data is updated to the valid start time, and the new memory data containing the first time parameter and the second time parameter is written to storage, wherein the second time parameter is the system record time when the system writes or updates the new memory data; The updated existing memory data is associated with the newly written memory data and stored together to form a state evolution record.
6. The method according to claim 5, characterized in that, The process of determining the target fact corresponding to the new memory data based on the memory content and metadata information of the new memory data, and determining the existing memory data corresponding to the target fact in the memory data associated with the user identifier based on the target fact, includes: The memory type identifier, fact name identifier, and attribute information associated with the memory content are obtained from the new memory data. The memory type identifier is used to indicate that the new memory data belongs to one of user preferences, state parameters, or behavior records. Generate fact matching conditions based on the memory type identifier, the fact name identifier, and the attribute information; Retrieve memory data that meets the fact matching criteria from the memory data associated with the user identifier as a candidate existing set; In the candidate existing set, existing memory data that are within the establishment time range of the effective start time of the first time parameter of the new memory data are determined based on the first time parameter and are used as the existing memory data; When multiple existing memory data satisfy the conditions exist, the existing memory data with the largest second time parameter is determined as the existing memory data based on the second time parameter.
7. The method according to claim 1, characterized in that, The process of generating audit results based on the valid memory data set and recording audit logs corresponding to the audit request includes: An audit identifier is generated based on the audit request, and the user identifier, target time point, and decision task identifier associated with the audit request are obtained from the audit request. The effective memory data set is encapsulated into audit context data, which includes each memory data identifier, memory content, and corresponding first and second time parameters. An audit result is generated based on the audit context data, and the audit result includes the audit identifier, user identifier, target time point, and audit context data. Generate an audit log associated with the audit identifier. The audit log includes the user identifier, operation type, resource type, resource identifier, operation time parameter, and access context information. The access context information includes at least one of access address information, access terminal information, and jurisdiction information. The audit results are associated with and stored in the audit log for use in performing audit queries based on the audit identifier.
8. A smart agent memory auditing device based on dual time axes, characterized in that, include: A receiving module is used to receive memory data associated with a user identifier and to record a first time parameter and a second time parameter for each piece of memory data. The first time parameter is used to limit the time range in which the memory data is valid at the external fact level, and the second time parameter is used to limit the system recording time when the memory data is written or updated by the system. The determination module is used to perform a dual-timeline joint determination on the memory data based on the target time point when receiving an audit request containing a target time point, so as to determine the set of valid memory data. The dual-timeline joint determination includes: determining the memory data that is within the establishment time range of the target time point based on the first time parameter, and determining the memory data that has been written or updated by the system before the target time point based on the second time parameter. The update module is used to perform state invalidation update on the existing memory data corresponding to the new memory data when receiving new memory data corresponding to the target fact. The state invalidation update includes updating the end time of the first time parameter of the existing memory data to the start time of the first time parameter of the new memory data in the same transaction, and writing the new memory data to form a state evolution record. The generation module is used to generate audit results based on the valid memory data set and record audit logs corresponding to the audit request. The audit results include the target time point and memory data identifiers and time parameter information corresponding to the valid memory data set.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-modal semantic network driven agent context understanding method and system
CN120297287A
System and method for diachronic machine learning architecture
US20200364619A1