Smart city agent platform based on artificial intelligence and large model
By constructing urban heterogeneous diagrams and using the random walk semantic diffusion mechanism, the semantic correlation problem of smart city data management platform in heterogeneous data modeling is solved, dynamic modeling and risk identification of urban operating status are realized, and intelligent perception and decision-making capabilities of urban governance are improved.
Patent Information
- Application Number
- CN202510932878.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-08-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing smart city data management platform is difficult to effectively and uniformly model the semantic relationship between urban heterogeneous data, resulting in high expansion costs, incomplete coverage, poor timeliness, and difficult to realize real-time and dynamic urban operation situation awareness and prediction when facing dynamically expanded urban elements or new modalities.
The smart city intelligent body platform based on artificial intelligence and large models uses the random walk semantic diffusion and sliding window optimization mechanism to generate node representation matrix to realize dynamic modeling and risk identification of urban operating states.
It improves the intelligent perception and decision-making capabilities in urban governance, realizes automatic identification and aggregation of data in different modalities, has the advantages of data-driven, adaptable, scalable and interpretable, and supports continuous modeling and real-time updates of large-scale urban entities.
Smart Images

Figure CN120494430A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of urban management technology, and specifically relates to a smart city intelligent body platform based on artificial intelligence and large models. Background Art
[0002] In the current context of smart city development, urban operational data is becoming highly heterogeneous, multimodal, and rapidly evolving. Smart city construction relies on the ability to uniformly perceive, dynamically analyze, and predict and dispatch relationships between multiple entities, including people, places, events, objects, and organizations, to achieve efficient resource allocation, accurate risk warnings, and enhanced urban resilience. In existing technology systems, urban data management platforms generally adopt a centralized model governance architecture centered around a data warehouse, achieving cross-system data aggregation through data standardization, topic modeling, and indicator system consolidation. However, this approach primarily serves static queries and visual analysis, and has significant limitations for real-time, dynamic, and cross-modal urban operational situation awareness and prediction.
[0003] First, existing urban information platforms generally lack a unified modeling mechanism for the semantic relationships between heterogeneous urban data. In urban functional areas such as transportation, environmental protection, emergency response, and healthcare, data sources are distributed across diverse business systems and sensor terminals. Data formats range from structured to semi-structured and unstructured, and collection granularity and temporal frequency also vary. Traditional data modeling approaches construct semantic relationships based on table structures, entity-relationship models, or ontology libraries. These approaches require the definition of clear data specifications and domain vocabulary, as well as preprocessing and manual alignment of all data. Such approaches, when faced with dynamically expanding urban elements or newly added modalities, require redefining mapping rules, resulting in high expansion costs, incomplete coverage, and poor timeliness. Furthermore, rule-based entity alignment struggles to cope with the vast number of fuzzy, ambiguous, or context-dependent semantic expressions in urban contexts, limiting semantic fusion capabilities and making it difficult to construct a unified entity space with adaptive capabilities. Summary of the Invention
[0004] The main purpose of this invention is to provide a smart city intelligent agent platform based on artificial intelligence and large models. It can automatically identify and aggregate entity elements from the city's multi-source heterogeneous databases to construct a heterogeneous urban graph in a unified high-dimensional coordinate space; extract node representations that combine spatial topology and temporal evolution characteristics through random walk semantic diffusion and sliding window optimization mechanisms; use autoregressive recursion methods to predict future node states, and combine edge generation probabilities with structural differences to generate anomaly score vectors, thereby achieving dynamic modeling, accurate prediction, and risk identification of urban operating status. This platform has the advantages of being data-driven, adaptive, scalable, and interpretable, significantly enhancing intelligent perception and decision-making capabilities in urban governance.
[0005] In order to solve the above problems, the technical solution of the present invention is achieved as follows: A smart city intelligent agent platform based on artificial intelligence and a large model comprises: a city heterogeneous graph construction unit, a city heterogeneous graph analysis unit, and a city heterogeneous graph update management unit; the city heterogeneous graph construction unit is used to obtain entity elements from a city database through an artificial intelligence platform, treat each entity as a node, and then use the large model to identify all types of entity elements belonging to the same entity and regard them as the coordinates of the node corresponding to the entity, and construct a city heterogeneous graph according to the connection relationship of each node; the city heterogeneous graph analysis unit is used to perform dynamic heterogeneous graph state vectorization based on the city heterogeneous graph to obtain a standardized node state vector; based on the node state vector, random walk semantic diffusion is implemented to form a coupling feature matrix that combines spatial topological association and temporal evolution information; a total loss function is constructed based on the coupling feature matrix, and then iteratively updated and converged to obtain a globally consistent node representation matrix through projected gradient descent under the action of a sliding window across time slices; the city heterogeneous graph scheduling management unit is used to generate a future time prediction representation in an autoregressive state recursion based on the node representation matrix, and then obtain a predicted edge set through edge generation probability estimation, and calculate an anomaly score vector based on the predicted edge set.
[0006] Furthermore, in the city heterogeneous graph construction unit, the artificial intelligence platform calls the asynchronous batch retrieval interface of the city database, and performs a partition scan on the database table mapped to each type of entity according to the preset list; during the scanning process, redundant key conflict resolution and null value completion are performed on the query results to obtain a set of entity elements; for each set of entity elements, a corresponding node tag is generated according to the entity's unique identifier, and then each entity element record is attached to the original attribute cache of the node; using the cross-modal semantic aggregation capability of the large model, vectorized implicit alignment is performed on multiple types of entity elements under the same entity; during the implicit alignment process, the large model automatically identifies entity elements that describe the same entity but are stored in different data tables or use different naming conventions, and calculates the similarity confidence value; when the similarity confidence value reaches the preset merge threshold, the corresponding entity elements are merged into the same entity.
[0007] Furthermore, the coordinate dimensions between entities are equal, which is a set value, defined as the minimum number of entity element types among all entities; for each dimension, the coordinate of the entity in that dimension is defined as the mean of all entity elements of the type corresponding to that dimension; for each entity, if there is an intersection between the entity element sets of two entities, the two entities are judged to be connected; based on the coordinates of each entity and the connection relationship between entities, a city heterogeneous graph in a high-dimensional space is constructed.
[0008] Furthermore, the process of the city heterogeneous graph analysis unit performing dynamic heterogeneous graph state vectorization includes: determining the center position of the city heterogeneous graph as the origin; and considering the vector from the origin to each node as the node state vector of the node.
[0009] Furthermore, the city heterogeneous graph analysis unit performs a cross-time slice sliding window on each time slice. The number of construction nodes is The undirected adjacency matrix of , further calculate its degree matrix , and let the transfer matrix ; According to the node state vector Norm distribution, determine the starting probability vector from the origin to each node ; In the time slice Within, take each node as the starting point to execute The random walk, path transfer only relies on The non-zero entries in the row corresponding to the current node in the , gradually record the sequence of visited nodes; for each random walk, the frequency of occurrence is accumulated to a size of The visit count matrix ;right Perform row normalization to obtain the access probability matrix ; For the node pairs that are adjacent to each other in the graph ,Will and Take the average and write it back to two places to preserve the local spatial topological correlation information, and clear the diagonal elements to avoid self-loop bias; Stacked into a 3D tensor in a sliding window across time slices ; Then, for the tensor Perform a flattening operation on the time dimension, and transform each node The access probabilities in all time slices are concatenated into a vector , and concatenate all vectors vertically into a matrix ;right Perform singular value decomposition and select the front Singular vectors generate a dimensionality reduction matrix ,in Set to the minimum number of all entity types to ensure that different entity types are aligned in the same feature space; finally, output the coupling feature matrix in the order of node index .
[0010] Furthermore, the city heterogeneous graph analysis unit is In the lexicographic order of the node labels, the length is generated Node index table ; For any node pair , retrieve the time slice of two nodes Corresponding entity element set and , if the two sets have a non-empty intersection , then the node is identified With node There is a connection relationship in this time slice, otherwise it is deemed that there is no connection relationship; the connection relationship result is written into the size Matrix , specifically: If the node With node If there is a connection relationship, then , otherwise let ; After the matrix is written, all implement , to ensure that the matrix is symmetric about the main diagonal; then for all implement .
[0011] Furthermore, the heterogeneous graph analysis unit covers the continuous In the time slice, the access probability matrix of the corresponding time slice is converted into Concatenate rows in sequence to form the observation matrix , and use the current node to represent the matrix Multiplying it by its transpose gives the prediction matrix ,in is the minimum number of all entity types; squared by the matrix norm Measure the difference between the observation matrix and the prediction matrix to obtain the reconstruction loss; impose amplitude constraints and time smoothing constraints on the node representation matrix, specifically including: calculating the sum of squares of elements Form the amplitude constraint term and find the first moment of the sliding window and the end moment Node representation differences Form a smoothness constraint term; add the reconstruction loss, amplitude constraint term and smoothness constraint term with equal weights to obtain the total loss function: ; Set a fixed learning step size for each sliding window , and set the initial value of the node representation matrix to the convergence result of the previous sliding window; if it is the first sliding window, initialize it randomly and normalize it by row; perform projected gradient descent iteration and repeat it in the current sliding window: Calculate right Gradient ;according to Update the node representation matrix; perform unit projection on each row vector after the update and normalize its length to ensure that the scale of each node representation is consistent; determine the decrease in the total loss function, and end the current sliding window iteration if it is less than one thousandth; when all sliding windows have completed the iteration and the total loss function in each sliding window no longer decreases significantly, the node representation matrix is obtained. Denoted as the globally consistent node representation matrix.
[0012] Furthermore, the city heterogeneous graph scheduling management unit has recently A sequence of node representation matrices collected in consecutive time slices In the example, each node representation matrix is flattened row by row to a length of Column vector of , forming the design matrix , and let the target vector be the column vector at the most recent moment ;in, Indicates time slice The node representation matrix when ; Indicates time slice The node representation matrix when and Solving normal equations , and the length is The autoregressive coefficient vector ; is the transpose operation; represents the field of real numbers; according to Calculate the prediction column vector , and then Reshape to size Matrix , as a predictive representation of future moments; Indicates time slice The autoregressive coefficient vector when .
[0013] Furthermore, the city heterogeneous graph scheduling management unit Each row vector of performs unit processing so that the length of each node representation is ; For any unordered node pair , calculate the similarity , and accordingly define the edge generation probability , and the size is The probability matrix ; express No. OK; express No. Column; Calculation The median of all off-diagonal elements in , will satisfy Node pairs Record the predicted edge set , and keep Symmetric about the main diagonal; in obtaining the actual observed edge set Then, construct its observation adjacency matrix ; Calculate the difference matrix ,right The node-level difference vector is obtained by summing each row of ;Will Normalized by dividing by its maximum value, the range is obtained The anomaly score vector ; Represents the field of real numbers.
[0014] The smart city intelligent body platform based on artificial intelligence and large models of the present invention has the following beneficial effects: through the synergy of the artificial intelligence platform and the large model, it realizes the automatic recognition and aggregation of entity elements in different modalities, different naming conventions and different data tables, greatly reducing the cost of manual rule configuration and improving the efficiency and accuracy of data integration. Secondly, the present invention proposes to define a unified coordinate dimension with a minimum number of types, and construct edge relationships with the intersection of entity element sets to ensure that the constructed urban heterogeneous graph is comparable, complete and scalable. By introducing a semantic diffusion mechanism based on random walks, the platform can efficiently couple the spatial topological relationship in the graph structure with the time evolution characteristics, so that the node state representation has both structural expression ability and evolution trajectory memory ability. During the modeling process, the platform performs distributed optimization with sliding window sub-units, and combines the reconstruction error, amplitude constraint and time smoothing term in the total loss function to make the final generated node representation matrix have global consistency and time continuity. Furthermore, the platform uses autoregressive recursion of representation vectors to construct predictive representations for future moments. It generates an edge prediction probability matrix through inner product similarity, and then generates anomaly score vectors using a structural difference quantification algorithm. This enables proactive prediction and risk detection of future urban operational states. The entire process is end-to-end and highly automated, supporting continuous modeling and real-time updates of large-scale urban entities. This provides quantifiable, traceable, and explainable intelligent support for situational awareness, resource scheduling, and emergency response in smart city construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of the structure of a smart city agent platform based on artificial intelligence and large models provided by an embodiment of the present invention; Figure 2 A schematic diagram of the dynamic change process of the access probability matrix under the cross-time slice sliding window mechanism provided by an embodiment of the present invention; Figure 3A schematic diagram of the random walk path and access frequency distribution provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The terms "first," "second," "third," "fourth," and so forth (if any) in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments described herein can be practiced in an order other than that shown or described herein.
[0017] refer to Figure 1 , a smart city intelligent agent platform based on artificial intelligence and a large model, the platform comprising: a city heterogeneous graph construction unit, a city heterogeneous graph analysis unit, and a city heterogeneous graph update management unit; the city heterogeneous graph construction unit is used to obtain entity elements from the city database through the artificial intelligence platform, treat each entity as a node, and then identify all types of entity elements belonging to the same entity through the large model, treating them as the coordinates of the nodes corresponding to the entity, and constructing a city heterogeneous graph according to the connection relationship of each node; the city heterogeneous graph analysis unit is used to perform dynamic heterogeneous graph state vectorization based on the city heterogeneous graph to obtain a standardized node state vector; based on the node state vector, random walk semantic diffusion is implemented to form a coupling feature matrix that has both spatial topological association and time evolution information; a total loss function is constructed based on the coupling feature matrix, and then iteratively updated and converged to obtain a globally consistent node representation matrix through projected gradient descent under the action of a sliding window across time slices; the city heterogeneous graph scheduling management unit is used to generate a future moment prediction representation in an autoregressive state recursion based on the node representation matrix, and then obtain a prediction edge set through edge generation probability estimation, and calculate an anomaly score vector based on the prediction edge set.
[0018] The theoretical foundation of the Urban Heterogeneous Graph Construction Unit is cross-modal alignment and data-driven mapping. From an information-theoretic perspective, the large model maximizes the mutual information between entity elements in the semantic space, attracting multimodal descriptions that best explain the same real-world entity into the same vector cluster. The resulting node coordinates not only carry details from each modality but also achieve statistical semantic completeness. When the system uses the intersection of entity element sets to determine node connections, it essentially treats "co-occurrence" as an implicit conditional dependency. This approach is equivalent to abandoning the prior structure in a Bayesian network, generating the graph topology from data, and applying the minimum dimensionality principle to ensure that the coordinate space is consistent for all entity types. The Urban Heterogeneous Graph Analysis Unit relies on random walk semantic diffusion to further refine the local topology. Random walks can be viewed as Markov processes executed on the graph. They satisfy the properties of ergodicity and penalizing long paths, achieving the same adjacency smoothing effect as spectral clustering in a finite number of steps. Treating visit frequency as a semantic weight is equivalent to discretizing the heat diffusion equation onto a node grid. Each trajectory accumulation is convolved in the sense of a "weighted Laplace," allowing information from higher-order neighbors to be transferred to the local representation within a finite number of steps. Sliding windows across time slices ensures the temporal consistency of this diffusion process: the windows provide a fixed evolutionary observation length, ensuring that the diffusion results of each time slice have a strict order in the three-dimensional tensor. This sequential stacking essentially creates a time-differentiable spatial transformation operator.
[0019] Dimensionality reduction of the coupled feature matrix relies on the low-rank assumption of matrix factorization. Node behavior is typically driven by a small number of latent factors in the short term, so the observation tensor exhibits a low-rank structure after appropriate folding. Singular value decomposition is equivalent to finding an orthogonal basis that best explains the variance, sharing the same principle of minimum reconstruction error as principal component analysis. In the context of graph embedding, this step compresses all spatial and temporal correlations into the vector directions of the node representation matrix. The vector lengths are then unified onto the unit sphere in the subsequent projected gradient descent, forming the so-called "length-invariant, direction-learnable" constraint. Projected gradient descent thus transforms into a constrained optimization on a Riemannian manifold: updates are placed in the tangent space, then projected back onto the sphere, iteratively ensuring convergence to a local minimum satisfying the unit norm while avoiding gradient explosion and collapse. Autoregressive state recursion exploits the stationarity assumption of the vector autoregressive model. The time evolution of the row vectors of the node representation matrix can be approximated as a linear dynamical system. The process of predicting future vectors using linear combinations of historical vectors corresponds to minimum mean squared error projection, which is also the static limit of the Kalman filter under the Gaussian noise assumption. Since the row vectors are already normalized, they only need to be normalized again after the linear combination to maintain scale consistency. The edge generation probability is obtained by using the cosine of the angle, essentially converting the Euclidean angular distance between node pairs into distribution similarity; this metric has been shown in the field of metric learning to be translation-invariant and intuitive. Using the median threshold to define the predicted edge set is equivalent to splitting the probability distribution at the second quantile, which not only avoids sensitivity to extreme values but also provides a symmetric baseline for subsequent anomaly detection.
[0020] The calculation of the anomaly score vector follows the principle of residual analysis. The length of the anomaly score vector is consistent with the number of nodes in the city's heterogeneous graph, where each position corresponds to a specific node in the graph. The probability matrix is the expectation of future connections, while the actual adjacency matrix is the observed value; the difference between the two is accumulated in the row dimension, which is equivalent to a one-dimensional energy measurement for each node to measure the degree of deviation of its connection behavior from the model's expectations. This energy-based anomaly measurement is the same as the traditional reconstruction error test, but it limits its attention to the node itself and can be directly mapped to the city's operating entity, facilitating interpretation and intervention. Ultimately, the platform uses this anomaly score vector as a closed-loop feedback signal to continuously update the model or trigger external decisions, so that the entire smart city intelligent body platform theoretically forms an adaptive monitoring and prediction system supported by statistical learning, stochastic processes, and constrained optimization.
[0021] Furthermore, in the city heterogeneous graph construction unit, the artificial intelligence platform calls the asynchronous batch retrieval interface of the city database, and performs a partition scan on the database table mapped to each type of entity according to the preset list; during the scanning process, redundant key conflict resolution and null value completion are performed on the query results to obtain a set of entity elements; for each set of entity elements, a corresponding node tag is generated according to the entity's unique identifier, and then each entity element record is attached to the original attribute cache of the node; using the cross-modal semantic aggregation capability of the large model, vectorized implicit alignment is performed on multiple types of entity elements under the same entity; during the implicit alignment process, the large model automatically identifies entity elements that describe the same entity but are stored in different data tables or use different naming conventions, and calculates the similarity confidence value; when the similarity confidence value reaches the preset merge threshold, the corresponding entity elements are merged into the same entity.
[0022] To cope with high concurrent query pressure, the AI platform employs an asynchronous batch retrieval interface coupled with a partition scanning mechanism. This essentially leverages an event-driven model to shift I / O wait time in favor of CPU computation time. Partition scanning divides the database's physical files into independent data blocks. Each block is retrieved in a separate thread and written to memory via a zero-copy buffer. This approach is equivalent to treating the data stream as a composable, lazy sequence, ensuring that throughput scales linearly with the number of partitions as the query scope expands. Because the underlying storage may have multiple asynchronous replicas, the system employs an eventual consistency strategy based on write timestamps: in the event of conflicts with the same primary key, the most recently written record with the most comprehensive replication factor is retained. This is equivalent to achieving monotonic read guarantees using "most recent write first" in distributed consistency theory. Null value completion adheres to the principle of data lineage, prioritizing the tracing of the same field value in the entity's historical snapshots. If any missing values are still missing, the upstream data collection chain is backtracked to collect the missing data, ensuring accountability for the completion action.
[0023] The design of the node tag and raw attribute cache reflects the mutable-immutable separation pattern: node tags are immutable references pointing to mutable caches, allowing the same entity to maintain a single identity in concurrent write scenarios while enabling incremental updates of attribute content. Next, the large model's cross-modal semantic aggregation, based on contrastive learning, maps the vectors output by encoders from different modalities onto a unified semantic manifold through a shared projection head. Within this manifold, vector distances adhere to the principle of conditional mutual information minimization, ensuring that different modal views of the same entity are brought closer together while maximizing information. When calculating similarity confidence scores, the system compares the target vector with the center vectors of all candidate entity clusters using cosine distances, then maps the distance rankings into probabilistic interpretations. This process corresponds to a probabilistic approximation of the soft nearest neighbor distribution. Because the cache already accumulates the entity's multimodal historical vectors, the model leverages temporal coherence to enhance the robustness of confidence judgments. When the similarity confidence score reaches a preset merge threshold, the platform invokes a union-find structure to perform a merge operation on the in-memory graph, merging the dispersed nodes of the same entity and writing the merge event to the traceability log. This bottom-up, data-driven mapping process is theoretically equivalent to mapping complex urban features into a probabilistic graph that satisfies weak assumptions: weak assumptions refer to revealing entity associations solely through the data itself, without relying on a priori rules. The probabilistic graph quantifies the uncertainty of entity aggregation through similarity confidence values, thus providing the subsequent heterogeneous graph analysis unit with complete and confidence-labeled nodes and edges. Ultimately, the urban heterogeneous graph construction unit solidifies heterogeneous, asynchronous, and heteromodal raw data into a set of nodes with consistent coordinates and complete semantics, laying a reliable data foundation for the platform's subsequent dynamic analysis, prediction, and monitoring.
[0024] Furthermore, the coordinate dimensions between entities are equal, which is a set value, defined as the minimum number of entity element types among all entities; for each dimension, the coordinate of the entity in that dimension is defined as the mean of all entity elements of the type corresponding to that dimension; for each entity, if there is an intersection between the entity element sets of two entities, the two entities are judged to be connected; based on the coordinates of each entity and the connection relationship between entities, a city heterogeneous graph in a high-dimensional space is constructed.
[0025] To ensure that all entities are simultaneously in the same comparable coordinate system, the system first counts the entity elements of each entity by type and takes the minimum number of entity element types across all entities as the unified coordinate dimension. This principle eliminates the incompleteness introduced by missing dimensions by using the least common dimension, ensuring that no entity has empty slots in the coordinate space. From an information-theoretic perspective, this effectively provides all entities with the same information channel width, ensuring that subsequent node state vector comparisons are free of structural bias. The platform then feeds all entity elements of the corresponding type within each dimension into the semantic encoding pipeline of the large model, obtaining homogeneous vector representations and taking the mean as the coordinate for that dimension. This mean can be viewed as a statistically centralized sampling of the semantic distribution of elements of the same type, mitigating the effects of single outliers on the coordinates while preserving the overall trend of internal entity diversity. This ensures that the coordinates are both geometrically stable and representative. After all entities are mapped to this unified dimensional space, the system further determines the connection relationship based on whether there is an intersection in the sets of entity elements: intersection means that two entities share at least one entity element, indicating that they have overlapping resources, locations or identities in actual urban operations; this principle of connection based on set intersection is essentially a data-driven approach to capturing potential dependencies rather than relying on external rules, so it does not introduce prior bias. Ultimately, the platform integrates the coordinates of the entities with the connection relationships obtained from the intersection, places each entity in the same high-dimensional space, and establishes edges with shared elements to obtain a heterogeneous urban graph that retains both geometric position alignment and semantic association information. This graph provides a data foundation with a complete structure, consistent metrics, and reliable topology for a series of subsequent processes such as dynamic heterogeneous graph state vectorization, random walk semantic diffusion, and autoregressive prediction.
[0026] Furthermore, the process of the city heterogeneous graph analysis unit performing dynamic heterogeneous graph state vectorization includes: determining the center position of the city heterogeneous graph as the origin; and considering the vector from the origin to each node as the node state vector of the node.
[0027] When the urban heterogeneous graph analysis unit dynamically vectorizes the state of the urban heterogeneous graph, it first uses geometric methods to determine the "center of the urban heterogeneous graph." This center is measured as the equilibrium point of the mass distribution of the entire node coordinates, consistent with the traditional concept of center of mass. As nodes in the graph are added or deleted, or their coordinates are updated over time, the system recalculates this equilibrium point in real time, ensuring that the center always represents the global geometric center of mass at the current moment. The analysis unit then uses this center as the "origin" and uniformly translates the entire coordinate system, eliminating reference frame offsets caused by overall node drift between time slices. This ensures that the same node changes position in consecutive snapshots only due to its own motion or attribute changes, without generating spurious displacements due to global coordinate system shifts. In this case, the vector from the origin to each node is considered the node state vector for that node. This vector simultaneously encodes both the node's orientation and distance in high-dimensional space: the orientation reflects the node's relative orientation within the urban heterogeneous graph, while the distance expresses the node's separation from the global center of mass. Combining these two vectors in a single vector ensures that the node state vector contains both spatial topological associations and global position information. Since the origin is fixed at the real-time center of gravity, any change in the node state vector is directly mapped to the real dynamics of the node itself, providing absolutely consistent and time-comparable vector input for subsequent random walk semantic diffusion, coupled feature matrix construction, and autoregressive state recursion.
[0028] Furthermore, the city heterogeneous graph analysis unit performs a cross-time slice sliding window on each time slice. The number of construction nodes is The undirected adjacency matrix of , further calculate its degree matrix , and let the transfer matrix ; According to the node state vector Norm distribution, determine the starting probability vector from the origin to each node ; In the time slice Within, take each node as the starting point to execute Random walk, path transfer only relies on The non-zero entries in the row corresponding to the current node in the , gradually record the sequence of visited nodes; for each random walk, the frequency of occurrence is accumulated to a size of The visit count matrix ;right Perform row normalization to obtain the access probability matrix ; For the node pairs that are adjacent to each other in the graph ,Will and Take the average and write it back to two places to preserve the local spatial topological correlation information, and clear the diagonal elements to avoid self-loop bias; Stacked into a 3D tensor in a sliding window across time slices ; Then, for the tensor Perform a flattening operation on the time dimension, and transform each node The access probabilities in all time slices are concatenated into a vector , and concatenate all vectors vertically into a matrix ;right Perform singular value decomposition and select the front Singular vectors generate a dimensionality reduction matrix ,in Set to the minimum number of all entity types to ensure that different entity types are aligned in the same feature space; finally, output the coupling feature matrix in the order of node index .
[0029] The city heterogeneous graph analysis unit takes the time slice The observed high-dimensional urban heterogeneous graph is abstracted as a discrete Markov process. The theoretical basis is to regard nodes as states and edges as reachable relationships, and to use the undirected adjacency matrix and degree matrix Generate one-step transfer matrix This regularization method is equivalent to normalizing the random walk of the graph Laplace operator, so that In the spectral sense, it becomes an exponential approximation of the discrete diffusion operator. The norm reflects the Euclidean distance of the node from the geometric center. The platform maps the norm into a starting probability vector This is equivalent to introducing a physical location prior on the initial distribution, making it easier for nodes in the central area to generate random walk trajectories. The random walk length is According to the Markov chain mixing time theory, in most scale-free urban networks, logarithmic step size can cover most of the reachable states and still retain the information of the initial position; the restricted transfer can only occur at The non-zero columns of ensure that the trajectory diffuses exactly along the original graph topology. The access count matrix Essentially, the distribution of random walk paths in the limit time Empirical estimate of the next step; normalized by row to get After that, each row is the conditional arrival distribution of the node to other nodes, and the row symmetry operation Correspondingly, an undirected prior is imposed in the graph Laplace framework, and the self-information gain of the self-loop is removed by zeroing the diagonal, thereby obtaining a probability kernel that preserves the local second-order structure and is unbiased.
[0030] Sliding window across time slices Stacked as tensors along the time dimension From the perspective of manifold learning, it is equivalent to splicing multiple Markov diffusion kernels in time to form a time-varying diffusion geometry. Flattening the tensor and concatenating the node sequence to obtain the matrix Expand the spatial diffusion distribution along the time axis so that any node The row vector of It also carries the structural connectivity and evolutionary rhythm within the rolling window; such a construction can be seen as an inner product embedding of the time-varying random walk kernel. Low-rank features are present in real data because high-order interactions of urban entities are usually driven by a small number of latent factors; singular value decomposition In the sense of least squares, we search for a low-rank linear subspace with the minimum reconstruction error, and select Singular vectors This is equivalent to retaining the direction of maximum variance in the principal component analysis framework. The minimum number of all entity types forces different types to share the same dimension, which ensures that the embedded submanifolds of all entity types are completely nested in the same Euclidean space in the sense of conformal mapping, thereby avoiding dimensional expansion or compression distortion caused by type imbalance. The final output coupling feature matrix Each row vector of is both the diffusion coordinate of the node in the spectral domain and its principal axis encoding in the time series; this dual meaning ensures that the subsequent optimization of the total loss function can simultaneously constrain the spatial structure reconstruction error and the time evolution smoothing term, achieving the theoretically optimal low-rank approximation of graph dynamics.
[0031] Furthermore, the city heterogeneous graph analysis unit is In the lexicographic order of the node labels, the length is generated Node index table ; For any node pair , retrieve the time slice of two nodes Corresponding entity element set and , if the two sets have a non-empty intersection , then the node is identified With node There is a connection relationship in this time slice, otherwise it is deemed that there is no connection relationship; the connection relationship result is written into the size Matrix , specifically: If the node With node If there is a connection relationship, then , otherwise let ; After the matrix is written, all implement , to ensure that the matrix is symmetric about the main diagonal; then for all implement .
[0032] Given a time slice When the platform first generates an index table in the lexicographic order of the node labels The core principle of this step is to determine a globally invariant one-dimensional coordinate so that the matrix rows and columns correspond to the nodes one by one and maintain position consistency in all subsequent algorithms; the lexicographic order is stable and unambiguous for parallel sharding, thus ensuring that the matrix slices written by different computing nodes can be spliced without conflict in a distributed environment. The system then records the set of entity elements held by each node in the current time slice as These sets are the semantic aggregation results of the large model after redundant key conflict resolution and null value completion. Therefore, their elements are not only structurally homogeneous, but also located around the same cluster center in the semantic vector space. To determine the node connection, we essentially use the "non-empty intersection" in set theory as the necessary and sufficient condition for the existence of a relationship: as long as two nodes share at least one entity element, it means that they have objective overlap at the raw data level, such as the same sensor event, a shared road network, or an overlapping resource, without introducing any artificial rules. The results are written into the adjacency matrix Binary As an indicator function, it ensures that the matrix elements can be directly used as discrete transition constraints in random walks and are also compatible with the graph Laplace form. After writing half of the matrix, the assignment is performed The matrix is made symmetric about the main diagonal. The symmetry corresponds to the reciprocal property of the "shared entity elements" relationship. Setting the diagonal elements to zero eliminates self-loops, so that the eigenvectors will not be distorted by the trivial arrival probability of the node to itself in the subsequent random walk or spectral decomposition. The whole process is equivalent to constructing an undirected, self-loop-free bipartite projection graph using set intersection in a high-dimensional semantic space, and the adjacency matrix It becomes the algebraic carrier of subsequent Markov diffusion kernel, graph Laplace or graph convolution operations, allowing spatial topology information to be injected into the subsequent time-varying graph analysis process in the form of minimal information loss and easiest calculation.
[0033] Furthermore, the city heterogeneous graph analysis unit covers the continuous In the time slice, the access probability matrix of the corresponding time slice is converted into Concatenate rows in sequence to form the observation matrix , and use the current node to represent the matrix Multiplying it by its transpose gives the prediction matrix ,in is the minimum number of all entity types; squared by the matrix norm Measure the difference between the observation matrix and the prediction matrix to obtain the reconstruction loss; impose amplitude constraints and time smoothing constraints on the node representation matrix, specifically including: calculating the sum of squares of elements Form the amplitude constraint term and find the first moment of the sliding window and the end moment Node representation differences Form a smoothness constraint term; add the reconstruction loss, amplitude constraint term and smoothness constraint term with equal weights to obtain the total loss function: ; Set a fixed learning step size for each sliding window , and set the initial value of the node representation matrix to the convergence result of the previous sliding window; if it is the first sliding window, initialize it randomly and normalize it by row; perform projected gradient descent iteration and repeat it in the current sliding window: Calculate right Gradient ;according to Update the node representation matrix; perform unit projection on each row vector after the update and normalize its length to ensure that the scale of each node representation is consistent; determine the decrease in the total loss function, and end the current sliding window iteration if it is less than one thousandth; when all sliding windows have completed the iteration and the total loss function in each sliding window no longer decreases significantly, the node representation matrix is obtained. Denoted as the globally consistent node representation matrix.
[0034] The urban heterogeneous graph analysis unit needs to find a balance between temporal continuity and spatial topological integrity, so it uses a sliding window sub-mechanism to perform constrained low-rank reconstruction of node representation. When there are time slices, the system first converts the access probability matrix of each time slice into Expand row by row in the order of node index and splice horizontally to obtain the observation matrix This splicing method explicitly flattens the time dimension, allowing the cross-temporal semantic diffusion patterns of the same node within the window to appear side by side along the columns. From the perspective of information theory, it is equivalent to mapping the Markov diffusion kernel sequence to a high-dimensional Euclidean space, so that the high-order adjacency probabilities of different time slices share a uniformly aligned row index. At the same time, the current node representation matrix After the row vector is projected to the unit, it has a spherical constraint and its inner product between rows is Characterizing the node similarity structure under prediction, it is written as a prediction matrix .because The size is only , less than The column width is set by repeating the row block. Interpolate to Aligned column coordinates to keep the reconstruction error calculation dimension consistent. Reconstruction loss The information gap between observation and prediction is measured by the square of the matrix binorm, which corresponds to the maximum likelihood estimation in the sense of least squares; the amplitude constraint term Control the total energy of the row vector to prevent the random walk signal from being meaninglessly amplified during the iteration process; smoothing constraint By penalizing the difference in representation between the first and last nodes of the window, a temporal consistency prior is introduced to prevent the representation of the same node from fluctuating violently in a short period of time.
[0035] The sum of the three terms constitutes the total loss function: Since all the quantities are consistent in dimension and appear in square form, the platform directly uses equal weighted summation without additional parameter adjustment, which reduces the sensitivity of hyperparameters during engineering deployment. , the system sets a fixed learning step size for each sliding window , the first window is randomly initialized Parallel unitization, the subsequent window sub-window inherits the convergence result of the previous window sub-window, realizing the warm start along the time rolling. and execute After completing the gradient descent in Euclidean space, the unit projection of each row vector is then performed to map the updated result back to the spherical manifold. This is equivalent to performing restricted optimization on the Riemannian manifold, which can prevent the gradient explosion caused by the representation length offset. The relative decrease of That is, when the window is judged to be converged at one thousandth of the time, invalid iterations are terminated in advance, thereby avoiding overfitting and saving computing power. As the sliding window slides on the time axis and repeats the above process, the node representation converges iteratively in the local window and maintains consistency globally through warm start. Finally, when all window sub- When the values tend to be stable and there is no obvious downward trend, the It is recorded as a globally consistent node representation matrix. This matrix theoretically provides the optimal low-rank approximation of spatial topology, semantic diffusion, and temporal smoothing, laying a unified and differentiable representation foundation for subsequent autoregressive state recursion, edge generation probability estimation, and anomaly score vector production.
[0036] Furthermore, the city heterogeneous graph scheduling management unit has recently A sequence of node representation matrices collected in consecutive time slices In the example, each node representation matrix is flattened row by row to a length of Column vector of , forming the design matrix , and let the target vector be the column vector at the most recent moment ;in, Indicates time slice The node representation matrix when ; Indicates time slice The node representation matrix when and Solving normal equations , and the length is The autoregressive coefficient vector ; is the transpose operation; represents the field of real numbers; according to Calculate the prediction column vector , and then Reshape to size Matrix , as a predictive representation of future moments; Indicates time slice The autoregressive coefficient vector when .
[0037] Furthermore, the city heterogeneous graph scheduling management unit Each row vector of performs unit processing so that the length of each node representation is ; For any unordered node pair , calculate the similarity , and accordingly define the edge generation probability , and the size is The probability matrix ; express No. OK; express No. Column; Calculation The median of all off-diagonal elements in , will satisfy Node pairs Record the predicted edge set , and keep Symmetric about the main diagonal; in obtaining the actual observed edge set Then, construct its observation adjacency matrix ; Calculate the difference matrix ,right The node-level difference vector is obtained by summing each row of ;Will Normalized by dividing by its maximum value, the range is obtained The anomaly score vector .
[0038] The city heterogeneous graph scheduling management unit regards the node representation matrix as a multivariate vector autoregressive process that evolves over time, and recently A collection of consecutive time slices Then, each node representation matrix is flattened row by row according to the node index order to a length of Column vector of , and then concatenate these column vectors side by side to form the design matrix , and define the column vector at the latest moment as the target vector This “row flattening” operation allows the original two-dimensional node representation to keep the node order unchanged in the column dimension and flatten it into a single column in the row dimension, thereby preserving the internal structure of each node. The platform uses the least squares principle to solve the normal equations. The length is The autoregressive coefficient vector , this equation can be guaranteed when the data is full rank and the noise mean is zero It is an unbiased optimal estimate in terms of mean square error.
[0039] get Afterwards, the system uses Calculate the prediction column vector , and then Reshape to size Matrix , this matrix is the predicted representation of the future moment. In order to avoid the scale imbalance caused by the difference in the length of representation of different nodes, the platform Each row vector of performs unit processing so that the length of each node representation is strictly equal to , thus ensuring that the subsequent cosine similarity calculation only focuses on direction information without numerical amplification deviation. Next, the system , use row vector dot product to calculate similarity , the interval The linear mapping of cosine similarity on is The probability of edge generation on , and then the size is The probability matrix .
[0040] Based on statistical robustness considerations, the platform does not directly set artificial thresholds, but calculates The median of all off-diagonal elements in As the adaptive threshold, The node pairs are collected as prediction edge sets , and write the symmetric structure to maintain the non-directionality. Then, when the real time slice Arrives and generates observation edge sets When the system constructs the observation adjacency matrix in real time , the predicted probability matrix and Take the absolute difference to get the difference matrix ;matrix The sum of each row of forms the node-level difference vector , this vector is mathematically equivalent to accumulating the probability residuals between each node and all its neighbors, measuring the degree to which the overall behavior of the node deviates from the prediction. In order to obtain comparable dimensions, the platform Divide by its largest element and normalize, and the range is strictly limited to The anomaly score vector .
[0041] The closer the value is to The greater the difference between the corresponding node edge behavior and the autoregressive model prediction, the closer This means that the node behavior is consistent with the historical dynamics; this normalization method not only eliminates the impact of network scale changes on threshold selection, but also allows the distribution of anomalies in different time slices to be directly compared. The changes in node representation within a window can be explained by linear combinations; the solution of the normal equation essentially gives the projection coefficients in the Hilbert space, ensuring yes In by Orthogonal projection on the span subspace, so if there is no drastic nonlinear jump in future behavior, the prediction error will mainly come from noise. The cosine similarity mapping uses the geometric properties of the normalized vector to convert the vector angle into probability. This approach ensures and The elements of are all on the same scale, so that the difference matrix The absolute value operation has direct probabilistic significance. Through this combination of linear prediction, probability estimation, and residual normalization, the dispatch management unit can perform real-time anomaly detection of urban operation status without the need for external prior rules or hyperparameter adjustment, providing quantitative and interpretable risk signals for subsequent decision-making modules.
[0042] The following is an example of how the smart city intelligent agent platform based on artificial intelligence and large models can complete the collaborative operation of the three stages of urban heterogeneous graph construction, urban heterogeneous graph analysis, and urban heterogeneous graph scheduling and management on the data stream. This example only selects four actual and interrelated urban entities: the main urban area hospital H1, the central primary school S1, the No. 2 water pump station W1, and the fire station F1. The platform first asynchronously batch searches the structured and unstructured fields of these four types of entities in the city database. After the redundant key conflicts are resolved and the null values are filled in, the search results are obtained to obtain the following entity element set: H1 has {substation101, district3} and geographic coordinates , S1 has {substation101,district3} and coordinates , W1 has {water_network_5} with coordinates , F1 has {district3} with coordinates Since the minimum number of entity element types in the four entities is (longitude and latitude in geographic coordinates), the platform fixes the coordinate dimensions to After the large model completes cross-modal semantic aggregation of all entity elements, it uses the mean of all elements in the same dimension as the node coordinates, so the entity coordinates still maintain the above position value. The platform uses whether the entity element set intersects as the edge condition. It can be seen that H1 and S1, H1 and F1, S1 and F1 share district3 or substation101, and other combinations have no shared elements, so the time slice is constructed. The adjacency matrix .
[0043] Degree Matrix , the transfer matrix So it becomes: .
[0044] The platform then calculates the geometric center , get the offset vectors from the four nodes to the center and take Norm, normalized to the starting probability vector .
[0045] In order to capture high-order adjacency relationships, the platform executes a query of length 1 with each node as the source within the time slice. Random walk, each source node repeats the experiment Get the access count matrix: .
[0046] After row normalization and symmetrical averaging, we get the access probability matrix: .
[0047] Set the width of the sliding window across time slices , the platform in the subsequent time slice and Obtained in the same way and , and concatenate the three matrices along the columns to generate the observation matrix .right Perform singular value decomposition and take the minimum number of all entity types The first two columns of singular vectors are used as the initial node representation matrix .
[0048] The platform defines the total loss function within the window: , and use the learning step size Perform projected gradient descent. Whenever The relative decline is less than That is, terminate the current window sub-iteration and converge After the complete time axis scrolling, the globally consistent node representation matrix is parallelized and its row vector length is Then enter the scheduling management unit stage. Assume the review window , the platform characterizes the last two convergences and Flatten the rows to get the design matrix , the target vector . Solve the normal equation to get the autoregressive coefficient vector .
[0049] Prediction column vector , reshaped into a prediction representation matrix: , and then normalize to get: .
[0050] Similarity Matrix , numerically: .
[0051] Extract the median of all off-diagonal elements , get the predicted edge set . Actual observation time slice The adjacency matrix still maintains The local topology described in , so .
[0052] Difference Matrix , row summation to obtain the node-level difference vector .
[0053] After normalization, the anomaly score vector is given , we can see that node W1 has the highest abnormality, providing precise guidance for the platform's subsequent intervention logic.
[0054] Figure 2 This figure details the dynamic evolution of the access probability matrix under the cross-time-slice sliding window mechanism. This figure is a key technical implementation of the time series analysis of the urban heterogeneous graph analysis unit. The top of the figure depicts a complete timeline with four consecutive time slices clearly labeled: Time Slice 1, Time Slice 2, Time Slice 3, and Time Slice 4. These time slices represent snapshots of the urban heterogeneous graph at different moments in time. Rectangular boxes below the timeline indicate the coverage of the two sliding windows: Sliding Window 1 covers Time Slices 1 to 3, and Sliding Window 2 covers Time Slices 2 to 4, demonstrating the continuity and overlapping nature of the sliding window mechanism. Each time slice corresponds to a separate access probability matrix, which reflects the access relationship pattern between nodes within that time slice. The matrix for Time Slice 1 shows the initial access probability distribution, where values such as 0.3, 0.6, and 0.1 represent the access probability between different pairs of nodes. As time progresses, the matrix for time slice two exhibits different probability distribution patterns. The access probabilities of some node pairs change significantly, for example, the probability values for certain locations change from 0.6 to 0.7, reflecting the evolution of the network's dynamic characteristics. The matrix for time slice three further demonstrates this evolutionary trend, with some element values changing to 0.8 or even higher, while others drop to 0.0, indicating the dynamic adjustment of network connectivity patterns.
[0055] The access probability matrices for these different time slices are stacked in chronological order to form a three-dimensional tensor, as shown in the three-dimensional framework structure on the right side of the figure. The construction of this three-dimensional tensor strictly adheres to the technical solution outlined in the patent, stacking the access probability matrices for each time slice within a sliding window spanning the time slices, forming a three-dimensional tensor structure of size T×N×N. The three-dimensional framework in the figure uses multiple layers of rectangular stacking to represent this three-dimensional structure, with each layer representing a matrix for a time slice, and the stacking relationship between the layers is clearly visible. This visualization method intuitively demonstrates the data organization along the time dimension and provides a clear data foundation for subsequent singular value decomposition (SVD) operations. After the three-dimensional tensor is constructed, the system flattens it and performs SVD on it, ultimately generating a coupling feature matrix. The bottom of the figure shows the coupling feature matrix obtained after SVD. The values of each element in this matrix, such as 0.45, 0.32, and 0.23, represent the representation values of different nodes in the reduced feature space. The magnitude of these values reflects the importance and influence of the node within the entire time series. Larger values in the matrix, such as 0.52 and 0.79, indicate that the corresponding nodes have strong feature expression capabilities, while smaller values, such as 0.19 and 0.10, indicate that the features at the corresponding locations are relatively weak. The entire coupled feature matrix generation process embodies the patented technical solution's design concept of combining spatial topological associations with temporal evolution information. By integrating information from multiple time slices into a unified feature space, it achieves effective modeling and characterization of the dynamic characteristics of heterogeneous urban graphs.
[0056] Figure 3This figure illustrates the complete process of random walk paths and visit frequency distribution. This figure represents the core of the random walk semantic diffusion mechanism within the urban heterogeneous graph analysis unit. In this figure, a sample network consisting of six nodes, labeled A, B, C, D, E, and F, is constructed. These nodes represent different entities within the urban heterogeneous graph. Nodes are connected by edges, forming a complex network topology. Nodes A, B, and C are located at the top of the network, while nodes D, E, and F are located at the bottom. Horizontal, vertical, and diagonal connections exist between nodes, reflecting the multidimensional relationships between urban entities. During a random walk, the system transitions according to the nonzero entries in the row corresponding to the current node in the transition matrix. Two typical random walk paths are illustrated in the figure using different dashed line patterns. The first random walk path, represented by a short dashed line, starts at node A, passes through nodes B and C, then transitions to node E in the bottom layer, and finally returns to node D, completing a complete traversal cycle. The second random walk path, represented by a long dashed line, starts at node B, visits node A, then turns to node E, and then visits node F, demonstrating different walk trajectories and visit patterns. These paths are generated strictly following the patent's random walk rule of logarithmic length times twice the number of nodes, ensuring a thorough exploration of the network structure.
[0057] During the random walk, the system records the frequency of visits to each node in real time. These statistics are displayed in the frequency statistics area on the right side of the figure. According to the statistical results, node B has the highest frequency of visits, reaching 6 times, indicating its high centrality and importance in the network. Node E has a frequency of visits of 5 times, ranking second, while node A has a frequency of visits of 4 times. In contrast, nodes C and F each have a frequency of visits of 3 times, and node D has the lowest frequency of visits, at only 2 times. This difference in visit frequency reflects the position and influence of different nodes in the network topology and provides an important basis for subsequent node importance assessment. The visit frequency statistics are further converted into a visit probability matrix, as shown in the three-by-three matrix example in the lower right corner of the figure. Each element in this matrix represents the probability of visiting from one node to another, with black squares representing high probability values and white squares representing low probability values. For example, high probability values of 0.8 and 0.9 are marked in black, while low probability values such as 0.1, 0.2, and 0.3 are marked in white. This probability matrix construction adheres to the patent's requirement for row-normalized access count matrices, ensuring that the sum of each row's elements is 1, meeting the basic requirements of probability distribution. By averaging the probabilities of adjacent node pairs, the system preserves local spatial topological associations while simultaneously clearing diagonal elements to zero to avoid self-loop bias.
[0058] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A smart city agent platform based on artificial intelligence and large models, characterized by: The platform includes: a city heterogeneous graph construction unit, a city heterogeneous graph analysis unit, and a city heterogeneous graph update management unit; the city heterogeneous graph construction unit is used to obtain entity elements from the city database through an artificial intelligence platform, treat each entity as a node, and then identify all types of entity elements belonging to the same entity through a large model, treating them as the coordinates of the nodes corresponding to the entity, and constructing a city heterogeneous graph according to the connection relationship of each node; the city heterogeneous graph analysis unit is used to perform dynamic heterogeneous graph state vectorization based on the city heterogeneous graph to obtain a standardized node state vector; based on the node state vector, random walk semantic diffusion is implemented to form a coupling feature matrix that has both spatial topological association and time evolution information; a total loss function is constructed based on the coupling feature matrix, and then iteratively updated and converged to obtain a globally consistent node representation matrix through projected gradient descent under the action of a sliding window across time slices; the city heterogeneous graph scheduling management unit is used to generate a future moment prediction representation in an autoregressive state recursion based on the node representation matrix, and then obtain a predicted edge set through edge generation probability estimation, and calculate an anomaly score vector based on the predicted edge set.
2. The smart city agent platform based on artificial intelligence and large models as claimed in claim 1, characterized in that: In the city heterogeneous graph construction unit, the AI platform calls the asynchronous batch retrieval interface of the city database and performs a partition scan on the database table mapped to each entity type based on a preset list. During the scan, redundant key conflicts are resolved and null values are filled in on the query results to obtain a set of entity elements. For each set of entity elements, a corresponding node tag is generated according to the entity's unique identifier, and each entity element record is then attached to the original attribute cache of the node. Leveraging the cross-modal semantic aggregation capabilities of the large model, vectorized implicit alignment is performed on multiple types of entity elements under the same entity. During the implicit alignment process, the large model automatically identifies entity elements that describe the same entity but are stored in different data tables or use different naming conventions, and calculates the similarity confidence value; when the similarity confidence value reaches the preset merge threshold, the corresponding entity elements are merged into the same entity.
3. The smart city agent platform based on artificial intelligence and large models as claimed in claim 2, characterized in that: The coordinate dimensions between entities are equal, which is a set value, defined as the minimum number of entity element types among all entities; for each dimension, the coordinate of the entity in that dimension is defined as the mean of all entity elements of the type corresponding to that dimension; for each entity, if the entity element sets of two entities have an intersection, the two entities are judged to be connected; based on the coordinates of each entity and the connection relationship between entities, a city heterogeneous graph in a high-dimensional space is constructed.
4. The smart city agent platform based on artificial intelligence and large models as claimed in claim 3, characterized in that: The process of the city heterogeneous graph analysis unit performing dynamic heterogeneous graph state vectorization includes: determining the center position of the city heterogeneous graph as the origin; and considering the vector from the origin to each node as the node state vector of the node.
5. The smart city agent platform based on artificial intelligence and large models as claimed in claim 4 is characterized in that: The city heterogeneous graph analysis unit is in a sliding window across time slices, and for each time slice The number of construction nodes is The undirected adjacency matrix of , further calculate its degree matrix , and let the transfer matrix ; According to the node state vector Norm distribution, determine the starting probability vector from the origin to each node ; In the time slice Within, take each node as the starting point to execute The random walk, path transfer only relies on The non-zero entries in the row corresponding to the current node in the , gradually record the sequence of visited nodes; for each random walk, the frequency of occurrence is accumulated to a size of The visit count matrix ;right Perform row normalization to obtain the access probability matrix ; For the node pairs that are adjacent to each other in the graph ,Will and Take the average and write it back to two places to preserve the local spatial topological correlation information, and clear the diagonal elements to avoid self-loop bias; Stacked into a 3D tensor in a sliding window across time slices ; Then, for the tensor Perform a flattening operation on the time dimension, and transform each node The access probabilities in all time slices are concatenated into a vector , and concatenate all vectors vertically into a matrix ;right Perform singular value decomposition and select the front Singular vectors generate a dimensionality reduction matrix ,in Set to the minimum number of all entity types to ensure that different entity types are aligned in the same feature space; finally, output the coupling feature matrix in the order of node index .
6. The smart city agent platform based on artificial intelligence and large models as claimed in claim 5, characterized in that: Urban heterogeneous graph analysis unit in a given time slice In the lexicographic order of the node labels, the length is generated Node index table ; For any node pair , retrieve the time slice of two nodes Corresponding entity element set and , if the two sets have a non-empty intersection , then the node is identified With node There is a connection relationship in this time slice, otherwise it is determined that there is no connection relationship; the connection relationship result is written into the size Matrix , specifically: If the node With node If there is a connection relationship, then , otherwise let ; After the matrix is written, all implement , to ensure that the matrix is symmetric about the main diagonal; then for all implement .
7. The smart city agent platform based on artificial intelligence and large models as claimed in claim 6, characterized in that: The continuous coverage of the sliding window sub-coverage of the urban heterogeneous graph analysis unit in each time slice In the time slice, the access probability matrix of the corresponding time slice is converted into Concatenate rows in sequence to form the observation matrix , and use the current node to represent the matrix Multiplying it by its transpose gives the prediction matrix ,in is the minimum number of all entity types; squared by the matrix norm Measure the difference between the observation matrix and the prediction matrix to obtain the reconstruction loss; Apply amplitude constraints and time smoothing constraints to the node representation matrix, specifically including: calculating the sum of squares of elements Form the amplitude constraint term and find the first moment of the sliding window and the end moment Node representation differences Form a smoothness constraint term; add the reconstruction loss, amplitude constraint term and smoothness constraint term with equal weights to obtain the total loss function ; Set a fixed learning step size for each sliding window , and set the initial value of the node representation matrix to the convergence result of the previous sliding window; if it is the first sliding window, initialize it randomly and normalize it by row; perform projected gradient descent iteration and repeat it in the current sliding window: Calculate right Gradient ;according to Update the node representation matrix; perform unit projection on each updated row vector and normalize its length to ensure the consistency of the node representation scale; determine the decrease in the total loss function; if it is less than one thousandth, end the sliding window sub-iteration; When all sliding windows have completed iteration and the total loss function in each sliding window no longer decreases significantly, the node representation matrix Denoted as the globally consistent node representation matrix.
8. The smart city agent platform based on artificial intelligence and large models as claimed in claim 7, characterized in that: The city heterogeneous graph scheduling management unit has recently A sequence of node representation matrices collected in consecutive time slices In the example, each node representation matrix is flattened row by row to a length of Column vector of , forming the design matrix , and let the target vector be the column vector at the most recent moment ;in, Indicates time slice Node representation matrix when ; Indicates time slice The node representation matrix when and Solving normal equations , and the length is The autoregressive coefficient vector ; is the transpose operation; represents the field of real numbers; according to Calculate the prediction column vector , and then Reshape to size Matrix , as a predictive representation of future moments; Indicates time slice The autoregressive coefficient vector when .
9. The smart city agent platform based on artificial intelligence and large models as claimed in claim 8, characterized in that: Urban heterogeneous graph scheduling management unit Each row vector of performs unit processing so that the length of each node representation is ; For any unordered node pair , calculate the similarity , and accordingly define the edge generation probability , and the size is The probability matrix ; express No. OK; express No. Column; Calculation The median of all off-diagonal elements in , will satisfy Node pairs Record the predicted edge set , and keep Symmetric about the main diagonal; in obtaining the actual observed edge set Then, construct its observation adjacency matrix ; Calculate the difference matrix ,right The node-level difference vector is obtained by summing each row of ;Will Normalized by dividing by its maximum value, the range is obtained The anomaly score vector .