Hierarchical urban operation agent memory management method and system
By employing a hierarchical management approach and combining task intensity, time decay, and industry factors to calculate the dynamic weights of memory entries, a unified indexing mechanism is established. This addresses the timeliness and cross-modal retrieval issues in the memory management of intelligent agents in smart city operations, enabling efficient and accurate memory retrieval and decision support.
Patent Information
- Application Number
- CN202511444067.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-10
AI Technical Summary
Existing technologies for memory management of intelligent agents in smart city operations suffer from problems such as insufficient timeliness, single-factor driving, insufficient cross-modal capabilities, and unreasonable retrieval priorities. They fail to effectively combine task intensity, time decay, and key industry factors, resulting in unreasonable memory management and low decision-making accuracy.
A hierarchical management approach is adopted, which calculates the dynamic weight of memory items through task intensity factors, time decay factors and industry key factors, establishes a unified multimodal indexing mechanism, and combines semantic similarity and knowledge graph centrality for scoring and ranking, so as to realize hierarchical management of short-term, medium-term and long-term memory.
It improves the rationality and efficiency of memory retrieval, enhances the hit rate, timeliness and accuracy of emergency response and operation and maintenance decisions, and improves the integrity of multimodal data retrieval and decision support capabilities.
Smart Images

Figure CN120910313A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence and smart city, in particular to a hierarchical city operation intelligent agent memory management method and system. BACKGROUND
[0002] With the increasing application of city operation intelligent agents in smart property, city management, emergency command and other scenarios, intelligent agents need to process multi-modal data streams (work orders, sensors, videos, text logs, etc.), and have effective long-term memory sedimentation, dynamic forgetting and rapid retrieval ability in complex environments.
[0003] However, the traditional memory management mechanism generally has the following problems: lack of timeliness: unable to dynamically reflect task intensity and urgency; single factor driven: only rely on time or frequency, ignore industry key factors such as emergency level, risk, SLA (Service Level Agreement, service level agreement) and the like; lack of cross-modal capability: different types of data are stored in isolation, lacking unified indexing; retrieval priority is not reasonable: the sorting relies too much on semantic similarity, lacking task weight and knowledge network factors.
[0004] Existing research and application can be divided into the following categories: (1) hot and cold layering method: allocate data to "hot layer / cold layer" through access frequency or time, but this method focuses on storage media, lacking semantic memory evolution capability; (2) time decay method: use exponential decay function to make recent events have higher weight, but this method ignores task intensity and industry key factors; (3) semantic similarity retrieval: achieve through vector retrieval or large model matching, but this method lacks support for multi-task and emergency decision-making.
[0005] Therefore, the existing technology has not formed an effective solution in multi-time scale memory management, industry task intensity modeling, and multi-factor joint sorting. SUMMARY
[0006] In view of the above problems, the present application aims to provide a hierarchical city operation intelligent agent memory management method and system, which can manage city operation memory in a hierarchical manner under multi-time scale (STM / MTM / LTM), consider task intensity, time decay and industry key factors in memory update and retrieval, realize multi-modal unified indexing and cross-modal retrieval, and improve the hit rate, timeliness and accuracy of emergency disposal and operation decision-making.
[0007] To solve the above technical problems, the present application provides the following technical solutions:
[0008] On the one hand, a hierarchical city operation intelligent agent memory management method is provided, which comprises the following steps:
[0009] S1, collect multi-modal task data of smart city operation;
[0010] S2, estimate the occurrence intensity of multi-modal task data in the time dimension to obtain a task intensity factor;
[0011] S3, combine the task intensity factor, the time decay factor and the industry key factor to calculate the dynamic weight of the memory entry;
[0012] S4, realize the hierarchical evolution of short-term memory, medium-term memory and long-term memory according to the dynamic weight of the memory entry;
[0013] S5, for multi-modal task data, establish a unified embedding and indexing mechanism and store it in the same memory knowledge graph;
[0014] S6, score by combining semantic similarity, dynamic weight and knowledge graph centrality, and perform memory retrieval and sorting according to the scoring results.
[0015] Optionally, in step S1, the multi-modal task data includes work order, sensor value, monitoring video, text log, voice dialogue and alarm information.
[0016] Optionally, in step S2, the calculation method of the task intensity factor I(t) includes sliding window statistics method and statistical method based on Hawkes self-excitation process;
[0017] The sliding window statistics method is calculated as follows:
[0018]
[0019] Wherein, I win (t) is the task intensity factor calculated by the sliding window statistics method, N(t-W, t) represents the number of task triggers in the time interval [t-W, t], and W is the length of the sliding time window.
[0020] The statistical method based on Hawkes self-excitation process is calculated as follows:
[0021]
[0022] Wherein, I hawkes (t) is the task intensity factor calculated by the statistical method based on Hawkes self-excitation process, μ is the basic trigger intensity, which represents the background trigger frequency when there is no history event, t j represents the time point of the jth past task trigger, α represents the trigger intensity brought by each task trigger, and β is the short-term decay coefficient, which controls the speed of the trigger intensity decreasing with time.
[0023] Optionally, in the step S3, the dynamic weight is calculated as follows:
[0024] wherein, W i (t) represents the dynamic weight of the i-th memory entry at time t, I i (t) represents the task intensity of the i-th memory entry, represents the time decay factor of the i-th memory entry, wherein, β i is the long-term decay coefficient of the i-th memory entry, Δt represents the time interval since the last triggering of the i-th memory entry, S i represents the emergency level factor, R i represents the risk factor, A i represents the SLA urgency factor, and γ, δ, η are the adjustment coefficients of the emergency level factor, the risk factor, and the SLA urgency factor, respectively.
[0025] The emergency level factor, the risk factor, and the SLA urgency factor together constitute the industry key factor.
[0026] Optionally, in the step S4, the hierarchy evolution rule includes promotion rules and elimination rules.
[0027] The promotion rules include:
[0028] If the dynamic weight W i of the memory entry is greater than a first threshold T1, the corresponding memory entry is promoted from short-term memory to medium-term memory; if the dynamic weight W i of the memory entry is greater than a second threshold T2, the corresponding memory entry is promoted from medium-term memory to long-term memory; wherein, T2>T1.
[0029] The elimination rules include:
[0030] If the dynamic weight W i of the memory entry is less than a minimum threshold T min or has not been updated for a preset time, the corresponding memory entry is deleted.
[0031] Optionally, in the step S5, for multi-modal task data, a unified graph-vector hybrid index is established by combining vectorization with a graph database and stored in the memory knowledge graph, so that the agent can call related memories across modalities when retrieving.
[0032] Optionally, in the step S6, the score is calculated by integrating the semantic similarity, the dynamic weight, and the knowledge graph centrality as follows:
[0033] wherein, Score iis the score of the i-th memory entry m i , Sim semantic (q, m i ) represents the semantic similarity between the query task q and the i-th memory entry m i , W i represents the dynamic weight of the memory entry m i , Centrality(m i ) represents the centrality of the memory entry m i in the memory knowledge graph, i.e., the knowledge graph centrality; a, b, and c are weight parameters of the semantic similarity, the dynamic weight, and the knowledge graph centrality, respectively.
[0034] Optionally, the method further comprises:
[0035] designing a standardized interface for automatically parsing task semantics and invoking the most relevant memory entries according to the task type and the hierarchical mechanism.
[0036] In another aspect, a hierarchical urban operation intelligent agent memory management system is provided for implementing any of the above methods, the system comprising:
[0037] a task flow acquisition module for acquiring multi-modal task data of smart city operation;
[0038] a task intensity estimation module for estimating the occurrence intensity of the multi-modal task data in the time dimension to obtain a task intensity factor;
[0039] a weight calculation module for calculating the dynamic weight of the memory entry in combination with the task intensity factor, the time decay factor, and the industry key factor;
[0040] a hierarchical memory management module for realizing the hierarchical evolution of short-term memory, medium-term memory, and long-term memory according to the dynamic weight of the memory entry;
[0041] a multi-modal indexing module for establishing a unified embedding and indexing mechanism for the multi-modal task data and storing it in the same memory knowledge graph;
[0042] a retrieval and sorting module for scoring by integrating the semantic similarity, the dynamic weight, and the knowledge graph centrality, and performing memory retrieval and sorting according to the scoring results.
[0043] In another aspect, an electronic device is provided, the electronic device comprising:
[0044] a processor;
[0045] A memory, the memory has computer readable instructions stored thereon, the computer readable instructions are loaded and executed by the processor, and the steps of the hierarchical city operation intelligent agent memory management method are realized.
[0046] In another aspect, a computer readable storage medium is provided, the computer readable storage medium has program codes stored therein, the program codes can be called and executed by a processor to perform the steps of the hierarchical city operation intelligent agent memory management method.
[0047] The technical solutions provided by the present application have at least the following beneficial effects:
[0048] In the embodiment of the present application, the dynamic weight mechanism combining the task intensity factor, the time decay factor and the industry key factor realizes the hierarchical evolution and layered management of short-term memory, medium-term memory and long-term memory, so that the intelligent agent is more in line with the forgetting and memory habits of human beings, and the rationality and efficiency of the intelligent agent memory call are guaranteed; through multi-modal data fusion, the memory call integrity and decision accuracy in complex task scenarios are improved; through the joint sorting mechanism of semantic similarity, dynamic weight and knowledge graph centrality, the hit rate, timeliness and accuracy of emergency disposal and operation and maintenance decision are improved; through industry interface adaptation, the feasibility and popularization value of the scheme in smart city and operation and maintenance management are enhanced. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0050] Figure 1 is a general flowchart of a hierarchical city operation intelligent agent memory management method provided by the embodiment of the present application;
[0051] Figure 2 is a hierarchical evolution state machine diagram provided by the embodiment of the present application;
[0052] Figure 3 is a joint sorting schematic diagram provided by the embodiment of the present application;
[0053] Figure 4 is a structural schematic diagram of a hierarchical city operation intelligent agent memory management system provided by the embodiment of the present application;
[0054] Figure 5 is a structural schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without any inventive effort fall within the protection scope of the present application.
[0056] In the embodiments of the present application, the words such as "exemplarily", "for example" and the like are used to represent as an example, illustration or description. Any embodiment or design scheme described as "exemplary" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the word "exemplary" is intended to present the concept in a specific manner.
[0057] The embodiments of the present application provide a hierarchical city operation intelligent agent memory management method, which can be implemented by an electronic device, which can be a terminal or a server. As shown in the figure, the processing flow of the method can include the following steps: Figure 1
[0058] S1, collecting multi-modal task data of smart city operation;
[0059] In the embodiments of the present application, the multi-modal task data includes work orders, sensor values, monitoring videos, text logs, voice conversations, alarm information and the like commonly seen in smart city and intelligent building scenarios.
[0060] S2, estimating the occurrence intensity of the multi-modal task data in the time dimension to obtain a task intensity factor.
[0061] In order to accurately reflect the triggering activity of different tasks in the near future, the present application introduces a task intensity factor I(t) when retrieving and sorting memories. The task intensity factor is used to quantify the activity of a memory entry in the time dimension, reflecting its importance to the current task. The calculation method of the task intensity factor I(t) includes the following two methods:
[0062] (1) Sliding window statistics method (basic implementation);
[0063] The number of task triggers in a given time window W is counted, and the average trigger rate is calculated:
[0064]
[0065] I win (t) is the task intensity factor calculated by the sliding window statistics method, N(t-W, t) represents the number of task triggers in the time interval [t-W, t], and W is the length of the sliding time window (such as 1 hour, 1 day).
[0066] This method can quickly estimate the recent activity level of the task, is simple to calculate, and is suitable for scenarios with high real-time requirements.
[0067] (2) Statistical method based on Hawkes self-exciting process (improved implementation);
[0068] In order to capture the "self-exciting effect" of task triggering, that is, a task trigger will increase the probability of triggering again in the short term, a Hawkes self-exciting process model is introduced:
[0069]
[0070] where I hawkes (t) is the task intensity factor calculated by the statistical method based on the Hawkes self-exciting process, μ is the basic trigger intensity, representing the background trigger frequency when there is no historical event, t j represents the time point of the jth past task trigger, α represents the trigger intensity brought by each task trigger, and β is the short-term decay coefficient, which controls the speed of the decay of the trigger intensity over time.
[0071] The short-term decay coefficient β in the Hawkes process is used to describe the short-term decay effect of a single task trigger, which corresponds to the decay within the task trigger intensity and is a dynamic decay at the event level. Its role is to control the influence of a task trigger to gradually decrease in the short term (for example, the relevance of a fire alarm trigger decreases after an hour).
[0072] This method can dynamically capture the evolution of the task in the time dimension, especially suitable for handling high-frequency task scenarios, and has stronger fitting ability.
[0073] In practical applications, the basic implementation and the improved implementation can be selected according to the scene requirements: for scenarios with high real-time and lightweight computing requirements, the sliding window statistics method can be used; for scenarios with high modeling accuracy and dynamicity requirements, the statistical method based on the Hawkes self-exciting process can be used.
[0074] The calculated task intensity factor I(t) will be a key factor in the joint ranking formula, which will work together with the time decay factor and the industry key factor to determine the priority of the memory retrieval result.
[0075] S3, combining the task intensity factor, the time decay factor and the industry key factor, calculates the dynamic weight of the memory entry.
[0076] In the embodiments of the present application, the dynamic weight is calculated as follows:
[0077] wherein, W i (t) represents the dynamic weight of the i th memory entry at time t, I i (t) represents the task intensity of the i th memory entry, represents the time decay factor of the i th memory entry, wherein, β i is the long-term decay coefficient of the i th memory entry, and Δt represents the time interval since the last triggering of the i th memory entry, i.e. the time difference between the current time t and the last occurrence time of the memory entry i (task i); S i represents the emergency level factor, R i represents the risk factor, A i represents the SLA urgency factor, and γ, δ, η are the adjustment coefficients of the emergency level factor, the risk factor and the SLA urgency factor, respectively. Among them, the emergency level factor, the risk factor and the SLA urgency factor jointly constitute the industry key factor.
[0078] The long-term decay coefficient β i in the dynamic weight formula is used to model the long-term decay mechanism of the memory entry i in the overall hierarchical memory system. Its role is: regardless of the task intensity, the priority of the entire memory entry will gradually decrease over time, corresponding to the “natural forgetting mechanism of the memory entry in the STM / MTM / LTM level”.
[0079] Therefore, the long-term decay coefficient β i and the short-term decay coefficient β in the preceding both act on different time scales. The short-term decay coefficient β solves the decay of the task short-term activity over time, and the long-term decay coefficient β i solves the decay of the memory entry in the global memory. The advantage of such design is: it not only ensures the sensitivity of recent high-frequency events (short-term decay coefficient β), but also ensures that the entire memory entry will not be occupied by old tasks for a long time (long-term decay coefficient β i ).
[0080] The time decay factor can dynamically reflect the “current value” of a memory. For example, if similar tasks occur frequently in the near future, even if a certain interval has passed in time, the weight can still be maintained at a high level, prompting the memory to be called first or rising to a higher level. On the contrary, the memory that has not been called for a long time and has low frequency will gradually reduce its weight until it is eliminated. This mechanism solves the shortcomings of the prior art that “all historical memories are treated equally” or “only sorted according to time”.
[0081] This invention combines task intensity factor, time decay factor and industry key factor to obtain the dynamic weight of memory entries, which comprehensively reflects the importance, timeliness and industry key attributes of the event.
[0082] S4. Based on the dynamic weights of memory items, realize the hierarchical evolution of short-term memory (STM), medium-term memory (MTM), and long-term memory (LTM).
[0083] In this embodiment of the invention, the agent's memory is divided into three levels: short-term memory, medium-term memory, and long-term memory. Short-term memory mainly stores immediate contextual information, such as real-time data and temporary dialogue content for emergency tasks; medium-term memory records the execution process of phased tasks, such as multiple equipment maintenance records or multiple security incident handling logs within a week; long-term memory, after summarization and semantic compression, is stored as reusable knowledge patterns and strategic experiences across scenarios. This hierarchical storage structure ensures that knowledge at different time scales can be reasonably preserved and retrieved, avoiding the problems of "either being forgotten too quickly or having redundant storage" in existing technologies.
[0084] refer to Figure 2 As shown, the rules of hierarchical evolution mainly include promotion rules and elimination rules.
[0085] Promotion rules include:
[0086] If the dynamic weight W of the memory entry i If the value is greater than the first threshold T1, the corresponding memory item is promoted from short-term memory to medium-term memory; if the dynamic weight W of the memory item is... i If the value is greater than the second threshold T2, the corresponding memory item is promoted from intermediate memory to long-term memory; where T2>T1.
[0087] Specifically, it is expressed as follows:
[0088] If W i T1: STM → MTM; If W i T2: MTM → LTM.
[0089] The elimination rules include:
[0090] If the dynamic weight W of the memory entry i Less than the minimum threshold T min If no update is made within a preset time, the corresponding memory entry will be deleted.
[0091] Specifically, it is expressed as follows:
[0092] If W i <T min Or if there has been no update for a long time → delete.
[0093] Wherein, the first threshold T1, the second threshold T2, the minimum threshold T min It can be adjusted according to application scenarios.
[0094] When a certain type of task occurs frequently in a short period of time, the related memory entries are gradually upgraded from short-term memory to medium-term memory; if it continues to appear and goes through semantic abstraction, it will be deposited as long-term memory, forming a reusable knowledge pattern. At the same time, for long-term memory entries that have not been called for a long time and have low weights, the invention cleans them up through compression or elimination mechanism, thereby maintaining the efficiency and compactness of the memory system. This hierarchical evolution mechanism enables the agent to have a "forgetting and depositing" ability similar to humans, simulating the process of "short-term memory" evolving into "long-term memory" in the human brain, ensuring that the system will not be affected by redundant memory and will not affect retrieval efficiency.
[0095] S5, for multi-modal task data, a unified embedding and indexing mechanism is established and stored in the same memory knowledge graph.
[0096] For multi-modal task data of smart city operation, the invention designs a unified embedding and indexing mechanism, which combines vectorization and graph database to establish a unified graph-vector hybrid index and store it in the memory knowledge graph, so that the agent can call related memories across modalities when retrieving. For example, in a fire scene, the agent can not only retrieve historical fire text reports, but also call sensor alarm data and monitoring video clips at the time. Compared with the existing technology of "different modal data stored separately and unable to be called uniformly", this mechanism significantly improves the memory calling integrity and decision accuracy in the task scenario.
[0097] S6, score according to semantic similarity, dynamic weight and knowledge graph centrality, and perform memory retrieval and sorting according to the score results.
[0098] As shown in Figure 3 , in the embodiment of the invention, the semantic similarity, dynamic weight and knowledge graph centrality are scored, and the calculation is as follows:
[0099] Wherein, Score i is the score of the i-th memory entry m i , Sim semantic (q, m i ) represents the semantic similarity between the query task q and the i-th memory entry m i , W i represents the dynamic weight of the memory entry m i , and Centrality(m i ) represents the memory entry m iThe centrality in the memory knowledge graph is knowledge graph centrality; a, b, and c are weight parameters of semantic similarity, dynamic weight, and knowledge graph centrality respectively.
[0100] The above scoring result realizes the comprehensive ranking of "relevance + importance + representativeness", and improves the hit rate, timeliness and accuracy of emergency disposal and operation and maintenance decision.
[0101] Further, the method further comprises:
[0102] A standardized interface (API) is designed to automatically analyze task semantics and call the most relevant memory entries according to semantic similarity, dynamic weight and knowledge graph centrality.
[0103] In order to ensure the feasibility of the technical scheme, the application designs a standardized interface (API) for the smart city operation and management platform, the emergency command system, the building equipment operation and maintenance platform and other typical applications. These interfaces can automatically analyze task semantics and call the most relevant memory entries according to the task type and the hierarchical mechanism. Taking fire emergency as an example, when the system detects a "high-rise building fire" event, the interface will preferentially search for long-term memory related to "fire disposal" (such as best practice process), and at the same time, combine the medium-term memory of recent regional fire alarms with real-time short-term data to form a comprehensive disposal scheme. This mechanism ensures that the intelligent agent not only can respond quickly, but also can learn from past experience to improve the scientific nature of emergency decision-making.
[0104] A specific implementation scheme provided by the embodiment of the application is as follows:
[0105] 1. System environment configuration
[0106] The method of the application can be implemented in a common software environment, for example, using Python language, combining a deep learning framework (such as TensorFlow or PyTorch), and storing and retrieving memory entries through a graph database (such as Neo4j) or a vector database (such as FAISS, Milvus). In a server environment, it can be deployed through a Docker container and support distributed expansion.
[0107] 2. Data structure design
[0108] The memory entry can adopt the following JSON data structure:
[0109] {
[0110] 'memory_id': UUID,
[0111] 'task_type': string,
[0112] 'content': string or multimodal data path,
[0113] 'timestamp': datetime,
[0114] 'frequency': int,
[0115] 'weight': float,
[0116] 'layer': STM / MTM / LTM
[0117] }
[0118] where frequency indicates the task trigger frequency, weight indicates the computed dynamic weight, and layer indicates the hierarchy that the memory entry belongs to.
[0119] 3. Algorithm Pseudocode
[0120] def update_memory(task):
[0121] lam = estimate_lambda(task.type)
[0122] dt = now() - task.timestamp
[0123] weight = lam exp(-beta[task.type] dt) (1+gamma task.S) (1+delta task.R) (1+eta task.A)
[0124] update_layer(task, weight)
[0125] save(task, weight)
[0126] def retrieve(query):
[0127] cands = index.search(query)
[0128] scores = {m: alpha semantic_sim(query,m)
[0129] + beta m.weight
[0130] + zeta graph_centrality(m) for m in cands}
[0131] return topk(scores, k=20)
[0132] Compared with the prior art, the application realizes hierarchical evolution and layered management of short-term memory, medium-term memory and long-term memory through a dynamic weight mechanism combining a task intensity factor, a time decay factor and an industry key factor, so that the agent is more in line with the forgetting and memory habits of humans, and the rationality and efficiency of memory calling of the agent are guaranteed; through multi-modal data fusion, the memory calling integrity and decision accuracy in a complex task scenario are improved; through a joint sorting mechanism of semantic similarity, dynamic weight and knowledge graph centrality, the hit rate, timeliness and accuracy of emergency disposal and operation and maintenance decision are improved; through industry interface adaptation, the feasibility and promotion value of the scheme in smart city and operation and maintenance management are enhanced.
[0133] Correspondingly, an embodiment of the application also provides a hierarchical city operation agent memory management system, Figure 4 is a structural block diagram of a hierarchical city operation agent memory management system according to an exemplary embodiment. As Figure 4 shown, the system comprises:
[0134] a task flow acquisition module configured to acquire multi-modal task data of smart city operation;
[0135] a task intensity estimation module configured to estimate the occurrence intensity of the multi-modal task data in the time dimension to obtain a task intensity factor;
[0136] a weight calculation module configured to combine the task intensity factor, a time decay factor and an industry key factor to calculate a dynamic weight of a memory entry;
[0137] a hierarchical memory management module configured to realize hierarchical evolution of short-term memory, medium-term memory and long-term memory according to the dynamic weight of the memory entry;
[0138] a multi-modal index module configured to establish a unified embedding and indexing mechanism for the multi-modal task data and store the multi-modal task data in the same memory knowledge graph;
[0139] a retrieval and sorting module configured to score by comprehensively considering semantic similarity, dynamic weight and knowledge graph centrality, and to perform memory retrieval and sorting according to the scoring result.
[0140] For ease of illustration, Figure 4 Only the main components of the system are shown. The system of the present embodiment can be used to perform Figure 1 The technical solutions of the method embodiments shown, the implementation principles and technical effects are similar, and details are not repeated here.
[0141] In an exemplary embodiment, the present application also provides an electronic device, which comprises:
[0142] A processor;
[0143] A memory, the memory has computer readable instructions stored thereon, the computer readable instructions are loaded and executed by the processor, and the steps of the hierarchical city operation agent memory management method are realized.
[0144] As Figure 5 The electronic device can include a processor and a memory. Optionally, it can also include a transceiver. Wherein, the processor is connected with the memory and the transceiver, such as through a communication bus. The memory has computer readable instructions stored thereon, the computer readable instructions are executed by the processor, and the steps of the hierarchical city operation agent memory management method are realized.
[0145] In a specific implementation, as an embodiment, the processor can include one or more CPUs. The electronic device can also include multiple processors, each of which can be a single-CPU or a multi-CPU. The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0146] Wherein, the memory is used to store the software program for executing the scheme of the present application, and is controlled by the processor to execute, and the specific implementation manner can refer to the above method embodiments, and details are not repeated here.
[0147] The transceiver is used to communicate with network devices or terminal devices. Optionally, the transceiver can include a receiver and a transmitter. Wherein, the receiver is used to realize the receiving function, and the transmitter is used to realize the transmitting function.
[0148] Optionally, the transceiver can be integrated with the processor, or can exist independently and be coupled with the processor through the interface circuit of the electronic device, and the present embodiment does not make specific limitation thereto.
[0149] It should be noted that, Figure 5The structure of the electronic device shown in the figures does not constitute a limitation on the electronic device, and an actual electronic device can include more or fewer components than shown, or combine some components, or arrange different components. In addition, the technical effects of the electronic device can refer to the technical effects of the above method embodiments, which are not described here.
[0150] In an exemplary embodiment, the present application also provides a computer readable storage medium, wherein at least one instruction is stored, the at least one instruction is loaded and executed by a processor to implement the steps of the hierarchical city operation intelligent agent memory management method described above. For example, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0151] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or terminal device. Without more limitations, the element defined by the sentence "including a…" does not exclude the presence of another identical element in the process, method, article or terminal device including the element.
[0152] In the specification, "one embodiment", "embodiment", "exemplary embodiment", "some embodiments" and the like indicate that the described embodiment can include a specific feature, structure or property, but not necessarily every embodiment includes the specific feature, structure or property. In addition, when a specific feature, structure or property is described in combination with an embodiment, it should be within the knowledge of those skilled in the related art to implement such a feature, structure or property in combination with other embodiments (whether or not explicitly described).
[0153] It should be understood that the term "and / or" in this paper is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. In addition, the character " / " in this paper generally represents that the associated objects before and after are an "or" relationship, but it can also represent an "and / or" relationship, which can be understood in reference to the context before and after.
[0154] In the present application, "at least one" means one or more, and "multiple" means two or more. "At least one of the following" or the like means any combination of the items, including any combination of single item or multiple items. For example, at least one of a, b, or c can mean a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0155] It should be understood that the size of the sequence number of the above-mentioned processes does not mean the order of execution in various embodiments of the present application. The execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0156] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the above-described apparatus embodiment is merely schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0157] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment.
[0158] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0159] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0160] The present application encompasses any substitutions, modifications, equivalent methods and solutions made on the essence and scope of the present application. In order to make the public have a thorough understanding of the present application, specific details are described in the following preferred embodiments of the present application, and the present application can be fully understood without the description of these details by those skilled in the art. In addition, in order to avoid unnecessary confusion to the essence of the present application, well-known methods, processes, flows, elements and circuits, etc. are not described in detail.
[0161] The above is only the preferred embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A hierarchical urban operation intelligent agent memory management method, characterized in that, The method comprises the following steps: S1, collecting multi-modal task data of the operation of the smart city; S2, estimating the occurrence intensity of the multi-modal task data in the time dimension to obtain a task intensity factor; S3, calculating the dynamic weight of the memory entry in combination with the task intensity factor, a time decay factor, and an industry key factor; S4, realizing the hierarchical evolution of short-term memory, medium-term memory, and long-term memory according to the dynamic weight of the memory entry; S5, establishing a unified embedding and indexing mechanism for the multi-modal task data and storing it in the same memory knowledge graph; S6, scoring by comprehensively considering semantic similarity, dynamic weight, and knowledge graph centrality, and performing memory retrieval and sorting according to the scoring results.
2. The hierarchical urban operation agent memory management method of claim 1, wherein, In the step S1, the multi-modal task data includes work orders, sensor values, monitoring videos, text logs, voice conversations, and alarm information. 3.The hierarchical urban operation agent memory management method of claim 1, wherein, In the step S2, the calculation method of the task intensity factor I(t) includes a sliding window statistical method and a statistical method based on a Hawkes self-exciting process. The sliding window statistical method is calculated as follows: ; where I win (t) is the task intensity factor calculated by the sliding window statistics method, N(t-W, t) represents the number of task triggers in the time interval [t-W, t], and W is the length of the sliding time window. The statistical method based on the Hawkes self-exciting process is calculated as follows: ; where I hawkes (t) is the task intensity factor calculated based on the statistical method of Hawkes self-excited process, μ is the basic trigger intensity, representing the background trigger frequency when there is no historical event, t j represents the time point of the jth past task trigger, α represents the trigger intensity brought by each task trigger; β is the short-term decay coefficient, which controls the speed of the trigger intensity decreasing with time. 4.The hierarchical urban operation agent memory management method of claim 1, wherein, In the step S3, the dynamic weight is calculated as follows: ; wherein, W i (t) represents the dynamic weight of the i-th memory entry at time t, I i (t) represents the task intensity of the i-th memory entry, represents the time decay factor of the i-th memory entry, wherein, β i is the long-term decay coefficient of the i-th memory entry, Δt represents the time interval since the last trigger of the i-th memory entry, S i represents the emergency level factor, R i represents the risk factor, A i represents the SLA urgency factor, γ, δ, η are respectively the adjustment coefficients of the emergency level factor, the risk factor and the SLA urgency factor; The emergency level factor, the risk factor, and the SLA urgency factor jointly constitute the industry key factor.
5. The hierarchical urban operating agent memory management method of claim 1, wherein, In the step S4, the rules of hierarchical evolution include promotion rules and elimination rules. The promotion rules include: If the dynamic weight W of the memory entry is greater than a first threshold T1, the corresponding memory entry is promoted from short-term memory to medium-term memory. i If the dynamic weight W of the memory entry is greater than a second threshold T2, the corresponding memory entry is promoted from medium-term memory to long-term memory; wherein T2>T1. i If the dynamic weight W of the memory entry is greater than a second threshold T2, the corresponding memory entry is promoted from medium-term memory to long-term memory; wherein T2>T1. The elimination rules include: If the dynamic weight W of the memory entry i is less than the minimum threshold T min or is not updated for a preset time, the corresponding memory entry is deleted.
6. The hierarchical urban operating agent memory management method of claim 1, wherein, In the step S5, for the multi-modal task data, a unified graph-vector hybrid index is established by combining vectorization and a graph database, and is stored in the memory knowledge graph, so that the agent can call related memories across modalities during retrieval.
7. The hierarchical urban operating agent memory management method of claim 1, wherein, In the step S6, the scoring calculation by comprehensively considering semantic similarity, dynamic weight, and knowledge graph centrality is as follows: ; wherein Score i is the score of the i-th memory entry m i , Sim semantic (q, m i ) represents the semantic similarity between the query task q and the i-th memory entry m i , W i represents the dynamic weight of the memory entry m i , and Centrality(m i ) represents the centrality of the memory entry m i in the memory knowledge graph, i.e., the knowledge graph centrality; a, b, and c are weight parameters of the semantic similarity, the dynamic weight, and the knowledge graph centrality, respectively.
8. The hierarchical urban operating agent memory management method of claim 1, wherein, The method further comprises: A standardized interface is designed, which is used to automatically analyze task semantics and call the most relevant memory entries according to the task type and hierarchical mechanism.
9. A hierarchical urban operating agent memory management system, the system being configured to implement the method of any one of claims 1 to 8, characterized in that, The system comprises: A task flow collection module for collecting multi-modal task data of the operation of the smart city; A task intensity estimation module for estimating the occurrence intensity of the multi-modal task data in the time dimension to obtain a task intensity factor; A weight calculation module for calculating the dynamic weight of the memory entry in combination with the task intensity factor, a time decay factor, and an industry key factor; A hierarchical memory management module for realizing the hierarchical evolution of short-term memory, medium-term memory, and long-term memory according to the dynamic weight of the memory entry; A multi-modal indexing module for establishing a unified embedding and indexing mechanism for the multi-modal task data and storing it in the same memory knowledge graph; A retrieval and sorting module for scoring by comprehensively considering semantic similarity, dynamic weight, and knowledge graph centrality, and performing memory retrieval and sorting according to the scoring results.
10. An electronic device, comprising: The electronic device comprises: A processor; A memory having computer readable instructions stored thereon, which are loaded and executed by the processor to implement the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Automatic optimization method and system based on intelligent data memory bank
CN118503390A
Memory retrieval method based on large language model and related device
CN119903125A
Large language model long-term memory method based on human cognitive inspiration
CN120493992A
Dialogue memory priority system based on multi-dimensional weighting
CN120670549A
Artificial cognitive declarative-based memory model to dynamically store, retrieve, and recall data derived from aggregate datasets
US20180240015A1
Cited By
Multi-agent-oriented task decomposition and capability routing operation method and system
CN121116253A
Personal data intelligent memory management method and system and electronic equipment
CN121478785A